-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
uv, tox and Python 3.12 #168
base: main
Are you sure you want to change the base?
Changes from all commits
34c277b
b383b02
7fb9540
615a080
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,6 +46,26 @@ of this workflow: | |
This is why typically in shared projects version releases are separated into | ||
their own pull requests. | ||
|
||
## Altering dependencies | ||
|
||
* Edit `pyproject.toml`. | ||
* `make sync_requirements` to refresh `requirements.txt`. | ||
* `make install test format_check lint_check mypy`. | ||
|
||
When you are ready, commit both `pyproject.toml` and | ||
`requirements.txt`. | ||
|
||
## tox | ||
|
||
Run [tox](https://tox.wiki/) to test the package on supported versions | ||
of Python. | ||
|
||
Each versions of Python listed in `tox.ini` must be present on your | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🐼 "version" |
||
system. On Linux it is probably easiest to build each version from | ||
source, using `make altinstall`. | ||
If you use Mac you can install each version using homebrew e.g., | ||
`brew install [email protected]`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to recommend |
||
|
||
## Publishing | ||
|
||
### Version number | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
install: | ||
pip install pip==23.3.1 | ||
pip install -e '.[dev,docs]' | ||
pip install uv==0.2.34 | ||
uv pip install -r requirements.txt --editable . | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would prefer this to be |
||
|
||
sync_requirements: | ||
uv pip compile --output-file=requirements.txt --extra=dev pyproject.toml | ||
|
||
# CI step wrappers | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ classifiers = [ | |
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
] | ||
license = {text = "MIT"} | ||
dependencies = [ | ||
|
@@ -41,27 +42,29 @@ dependencies = [ | |
|
||
[project.optional-dependencies] | ||
dev = [ | ||
"boto3==1.26.53", | ||
"botocore==1.29.53", | ||
"hypothesis==6.62.1", | ||
"moto[s3,sqs]==4.1", | ||
"mypy-boto3-s3==1.34.120", | ||
"mypy==1.10.0", | ||
"numpy==1.22.2", | ||
"pre-commit>=3.7.1", | ||
"psycopg2>=2.8.4", | ||
"pyarrow-stubs==10.0.1.6", | ||
"pytest-django==4.8.0", | ||
"pytest-mock==3.12.0", | ||
"pytest==8.0.2", | ||
"ruff==0.4.9", | ||
"time-machine==2.14.1", | ||
"twine==4.0.2", | ||
"types-openpyxl==3.0.4.5", | ||
"types-python-dateutil==2.8.19.20240106", | ||
"types-pytz==2024.1.0.20240203", | ||
"types-requests==2.28.11.8", | ||
"wheel==0.38.4", | ||
"boto3", | ||
"botocore", | ||
"hypothesis", | ||
"moto[s3,sqs]", | ||
"mypy-boto3-s3", | ||
"mypy", | ||
"numpy>=1.26.4", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's worth a comment to explain why we need the version filter. |
||
"pre-commit", | ||
"psycopg2", | ||
"pyarrow-stubs>=10.0.1.9", | ||
"pytest-django", | ||
"pytest-mock", | ||
"pytest", | ||
"ruff", | ||
"time-machine", | ||
"tox", | ||
"tox-uv", | ||
"twine", | ||
"types-openpyxl", | ||
"types-python-dateutil", | ||
"types-pytz", | ||
"types-requests", | ||
"wheel", | ||
] | ||
docs = [ | ||
"Sphinx==7.2.6", | ||
|
@@ -207,6 +210,8 @@ section-order = [ | |
filterwarnings = [ | ||
"error::RuntimeWarning", | ||
"error::DeprecationWarning", | ||
"ignore:datetime.datetime.utcfromtimestamp\\(\\) is deprecated and scheduled for removal in a future version:DeprecationWarning", | ||
"ignore:datetime.datetime.utcnow\\(\\) is deprecated and scheduled for removal in a future version:DeprecationWarning", | ||
"ignore:defusedxml.lxml:DeprecationWarning:zeep", | ||
"ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3:DeprecationWarning:(graphene|singledispatch)", | ||
# https://github.com/ktosiek/pytest-freezegun/issues/35 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably worth copying the makefile targets from the CookieCutterPackage repo:
https://github.com/octoenergy/cookiecutter-kraken-package/blob/main/%7B%7B%20cookiecutter.repo_name%20%7D%7D/makefile