Skip to content

Commit

Permalink
chore: Use uv for python dependency management
Browse files Browse the repository at this point in the history
  • Loading branch information
ghislainbourgeois committed Dec 19, 2024
1 parent 614564b commit d9c5192
Show file tree
Hide file tree
Showing 9 changed files with 1,208 additions and 213 deletions.
22 changes: 0 additions & 22 deletions .github/dependabot.yml

This file was deleted.

45 changes: 45 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended",
":disableRateLimiting",
":noUnscheduledUpdates",
":semanticCommits"
],
"automerge": true,
"automergeStrategy": "squash",
"automergeType": "pr",
"platformAutomerge": true,
"schedule": ["after 1am and before 3am every monday"],
"lockFileMaintenance": {
"enabled": true,
"schedule": ["after 1am and before 3am every wednesday"]
},
"timezone": "Etc/UTC",
"enabledManagers": ["pep621", "github-actions", "terraform"],
"packageRules": [
// Later rules override earlier rules
{
"matchBaseBranches": ["main", "v*"],
"matchManagers": ["pep621"],
"rangeStrategy": "bump",
"groupName": "Python dependencies"
},
{
// Bumping "pytest-asyncio" over 0.23 breaks the integration tests
"matchPackageNames": ["pytest-asyncio"],
"matchUpdateTypes": ["minor"],
"enabled": false
},
{
"matchBaseBranches": ["main", "v*"],
"matchManagers": ["github-actions"],
"groupName": "GitHub actions"
},
{
"matchBaseBranches": ["main", "v*"],
"matchManagers": ["terraform"],
"groupName": "Terraform"
},
],
}
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.

177 changes: 0 additions & 177 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 d9c5192

Please sign in to comment.