-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migrate migrate packaging to uv (#1244)
- Loading branch information
1 parent
81c8622
commit d9e26bd
Showing
10 changed files
with
938 additions
and
1,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,17 +28,13 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install poetry | ||
run: pipx install poetry | ||
- uses: actions/setup-python@v5 | ||
with: | ||
cache: poetry | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Dependencies | ||
run: poetry install | ||
- uses: astral-sh/setup-uv@v5 | ||
- run: uv sync --no-python-downloads | ||
shell: bash | ||
- name: Test with Pytest | ||
run: poetry run pytest --cov-report=xml | ||
- run: uv run pytest --cov-report=xml | ||
shell: bash | ||
- uses: codecov/[email protected] | ||
with: | ||
|
@@ -50,8 +46,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
cache: pip | ||
python-version: "3.9" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,10 +46,10 @@ Ready to contribute? Here's how to set yourself up for local development. | |
$ git clone [email protected]:your_name_here/django-codemod.git | ||
``` | ||
|
||
3. Install the project dependencies with [Poetry](https://python-poetry.org): | ||
3. Install the project dependencies with [uv](https://docs.astral.sh/uv/): | ||
|
||
```shell | ||
$ poetry install | ||
$ uv sync | ||
``` | ||
|
||
4. Create a branch for local development: | ||
|
@@ -63,7 +63,7 @@ Ready to contribute? Here's how to set yourself up for local development. | |
5. When you're done making changes, check that your changes pass our tests: | ||
|
||
```shell | ||
$ poetry run pytest | ||
$ uv run pytest | ||
``` | ||
|
||
6. Linting is done through [pre-commit](https://pre-commit.com). Provided you have the tool installed globally, you can run them all as one-off: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,63 @@ | ||
[build-system] | ||
build-backend = "poetry.core.masonry.api" | ||
requires = [ "poetry-core>=1" ] | ||
build-backend = "setuptools.build_meta" | ||
requires = [ "setuptools" ] | ||
|
||
[tool.poetry] | ||
[project] | ||
name = "django-codemod" | ||
version = "2.2.2" | ||
description = "A command line tool to automatically fix Django deprecations." | ||
authors = [ "Bruno Alla <[email protected]>" ] | ||
license = "MIT" | ||
readme = "README.md" | ||
keywords = [ "django", "codemod", "libCST" ] | ||
repository = "https://github.com/browniebroke/django-codemod" | ||
documentation = "https://django-codemod.readthedocs.io" | ||
keywords = [ | ||
"codemod", | ||
"django", | ||
"libCST", | ||
] | ||
license = { text = "MIT" } | ||
authors = [ | ||
{ name = "Bruno Alla", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.9" | ||
classifiers = [ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Natural Language :: English", | ||
"Operating System :: OS Independent", | ||
"Topic :: Software Development :: Libraries", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
packages = [ | ||
{ include = "django_codemod", from = "src" }, | ||
{ include = "tests", format = "sdist" }, | ||
"Programming Language :: Python :: 3.13", | ||
"Topic :: Software Development :: Libraries", | ||
] | ||
|
||
[tool.poetry.urls] | ||
"Bug Tracker" = "https://github.com/browniebroke/django-codemod/issues" | ||
"Changelog" = "https://django-codemod.readthedocs.io/en/stable/changelog.html" | ||
"Twitter" = "https://twitter.com/_BrunoAlla" | ||
"Mastodon" = "https://fosstodon.org/@browniebroke" | ||
|
||
[tool.poetry.scripts] | ||
djcodemod = "django_codemod.cli:djcodemod" | ||
|
||
[tool.poetry.dependencies] | ||
python = "^3.9" | ||
click = "<9" | ||
libcst = "==1.5.1" | ||
pathspec = ">=0.6,<1" | ||
rich = ">=10" | ||
rich-click = ">=1.0" | ||
|
||
[tool.poetry.dev-dependencies] | ||
parameterized = "^0.9.0" | ||
pytest = "^8.0.0" | ||
pytest-cov = "^6.0.0" | ||
pytest-mock = "^3.3" | ||
|
||
[tool.poetry.group.docs] | ||
optional = true | ||
|
||
[tool.poetry.group.docs.dependencies] | ||
myst-parser = { version = ">=0.16", python = ">=3.11" } | ||
sphinx = { version = ">=4.0", python = ">=3.11" } | ||
furo = { version = ">=2023.5.20", python = ">=3.11" } | ||
dependencies = [ | ||
"click<9", | ||
"libcst==1.5.1", | ||
"pathspec>=0.6,<1", | ||
"rich>=10", | ||
"rich-click>=1", | ||
] | ||
urls."Bug Tracker" = "https://github.com/browniebroke/django-codemod/issues" | ||
urls.Changelog = "https://django-codemod.readthedocs.io/en/stable/changelog.html" | ||
urls.documentation = "https://django-codemod.readthedocs.io" | ||
urls.Mastodon = "https://fosstodon.org/@browniebroke" | ||
urls.repository = "https://github.com/browniebroke/django-codemod" | ||
urls.Twitter = "https://twitter.com/_BrunoAlla" | ||
scripts.djcodemod = "django_codemod.cli:djcodemod" | ||
|
||
[dependency-groups] | ||
dev = [ | ||
"parameterized>=0.9,<1", | ||
"pytest>=8,<9", | ||
"pytest-cov>=6,<7", | ||
"pytest-mock>=3.3,<4", | ||
] | ||
docs = [ | ||
"furo>=2023.5.20; python_version>='3.11'", | ||
"myst-parser>=0.16; python_version>='3.11'", | ||
"sphinx>=4; python_version>='3.11'", | ||
] | ||
|
||
[tool.ruff] | ||
target-version = "py39" | ||
|
@@ -120,11 +123,16 @@ warn_no_return = true | |
show_error_codes = true | ||
|
||
[tool.semantic_release] | ||
version_toml = [ "pyproject.toml:tool.poetry.version" ] | ||
version_toml = [ "pyproject.toml:project.version" ] | ||
version_variables = [ | ||
"src/django_codemod/__init__.py:__version__", | ||
] | ||
build_command = "pip install poetry && poetry build" | ||
build_command = """ | ||
pip install uv | ||
uv lock | ||
git add uv.lock | ||
uv build | ||
""" | ||
|
||
[tool.semantic_release.changelog] | ||
exclude_commit_patterns = [ | ||
|
Oops, something went wrong.