Skip to content

Commit

Permalink
Merge pull request #497 from canonical/chore-cc005-v1.5
Browse files Browse the repository at this point in the history
chore: Use uv for python dependency management
  • Loading branch information
ghislainbourgeois authored Dec 19, 2024
2 parents 31fda26 + 304cbe6 commit f023ea4
Show file tree
Hide file tree
Showing 7 changed files with 1,163 additions and 190 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@

# Python
**/venv/**
**/.venv/**
*.pyc
*.egg-info/

# Charmcraft
*.charm
Expand Down
22 changes: 17 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,29 @@

To make contributions to this project, you'll need a working [Juju development setup](https://juju.is/docs/sdk/dev-setup).

You can use the environments created by `tox` for development:
This project uses `uv`. You can install it on Ubuntu with:

```shell
tox --notest -e integration
source .tox/integration/bin/activate
sudo snap install --classic astral-uv
```

You can create an environment for development with `uv`:

```shell
uv sync
source .venv/bin/activate
```

## Testing
This project uses `tox` for managing test environments. It can be installed
with:

```shell
uv tool install tox --with tox-uv
```

This project uses `tox` for managing test environments. There are some pre-configured environments
that can be used for linting and formatting code when you're preparing contributions to the project:
There are some pre-configured environments
that can be used for linting and formatting code when you're preparing contributions to the charm:

```shell
tox -e fmt # Format code
Expand Down
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
[project]
name = "sdcore-tests"
version = "0.1.0"
requires-python = ">=3.10"

dependencies = [
"codespell",
"jinja2",
"juju",
"pyright",
"pytest",
"pytest-operator",
"ruff",
]

# Testing tools configuration
[tool.coverage.run]
branch = true
Expand Down
8 changes: 0 additions & 8 deletions requirements.in

This file was deleted.

176 changes: 0 additions & 176 deletions requirements.txt

This file was deleted.

2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ setenv =
PYTHONBREAKPOINT=pdb.set_trace
PY_COLORS=1
deps =
-r{toxinidir}/requirements.txt
.
passenv =
PYTHONPATH
MODEL_SETTINGS
Expand Down
Loading

0 comments on commit f023ea4

Please sign in to comment.