-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Migration to pyproject.toml
#3338
base: master
Are you sure you want to change the base?
Changes from 40 commits
e4cddf2
b575804
0c7f24d
87de330
aee8e9c
06df545
5ad74bc
0816898
2e88012
a62ef47
d51c3b0
1ce319b
48b9029
e486da0
c9e2a8f
3e0720d
f9819be
483aa25
62f195a
cb3d1c1
aa22b4e
5e68ba0
d60b65f
77a223d
9bf7c67
68922bf
0e8c7cd
0c94ebb
57b56ea
4428baf
2821873
62fd597
43c2856
844d94d
0038252
1e7b2dc
9616953
12a9d8a
7be8a6d
cd6fee3
48650b7
6f8a76f
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 |
---|---|---|
|
@@ -13,35 +13,22 @@ jobs: | |
strategy: | ||
matrix: | ||
include: | ||
- python-version: "3.7" | ||
tox-env: py37-core | ||
- python-version: "3.8" | ||
tox-env: py38-core | ||
- python-version: "3.9" | ||
tox-env: py39-core | ||
- python-version: "3.10" | ||
tox-env: py310-core | ||
- python-version: "3.11" | ||
tox-env: py311-core | ||
- python-version: "3.12" | ||
tox-env: py312-core | ||
- tox-env: py38-core | ||
- tox-env: py39-core | ||
- tox-env: py310-core | ||
- tox-env: py311-core | ||
- tox-env: py312-core | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- name: Set up the latest version of uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache pip | ||
uses: actions/cache@v4 | ||
with: | ||
# This path is specific to Ubuntu | ||
path: ~/.cache/pip | ||
# Look to see if there is a cache hit for the corresponding requirements files | ||
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }} | ||
enable-cache: true | ||
cache-dependency-glob: "pyproject.toml" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip 'tox<4.0' | ||
uv tool install --python-preference only-managed --python 3.12 tox --with tox-uv | ||
- name: Setup MySQL DB | ||
run: | | ||
sudo /etc/init.d/mysql start | ||
|
@@ -51,7 +38,7 @@ jobs: | |
- name: Build | ||
env: | ||
TOXENV: ${{ matrix.tox-env }} | ||
run: tox | ||
run: uvx --with tox-uv tox run | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
|
@@ -81,42 +68,29 @@ jobs: | |
strategy: | ||
matrix: | ||
include: | ||
- python-version: "3.7" | ||
tox-env: py37-postgres | ||
- python-version: "3.8" | ||
tox-env: py38-postgres | ||
- python-version: "3.9" | ||
tox-env: py39-postgres | ||
- python-version: "3.10" | ||
tox-env: py310-postgres | ||
- python-version: "3.11" | ||
tox-env: py311-postgres | ||
- python-version: "3.12" | ||
tox-env: py312-postgres | ||
- tox-env: py38-postgres | ||
- tox-env: py39-postgres | ||
- tox-env: py310-postgres | ||
- tox-env: py311-postgres | ||
- tox-env: py312-postgres | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache pip | ||
uses: actions/cache@v4 | ||
- name: Set up the latest version of uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
# This path is specific to Ubuntu | ||
path: ~/.cache/pip | ||
# Look to see if there is a cache hit for the corresponding requirements files | ||
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }} | ||
enable-cache: true | ||
cache-dependency-glob: "pyproject.toml" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip 'tox<4.0' | ||
uv tool install --python-preference only-managed --python 3.12 tox --with tox-uv | ||
- name: Create PSQL database | ||
run: | | ||
PGPASSWORD=postgres psql -h localhost -p 5432 -c 'create database spotify;' -U postgres | ||
- name: Build | ||
env: | ||
TOXENV: ${{ matrix.tox-env }} | ||
run: tox | ||
run: uvx --with tox-uv tox run | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
|
@@ -135,91 +109,79 @@ jobs: | |
strategy: | ||
matrix: | ||
include: | ||
- python-version: "3.7" | ||
tox-env: py37-aws | ||
- python-version: "3.8" | ||
tox-env: py38-aws | ||
- python-version: "3.9" | ||
tox-env: py39-aws | ||
- python-version: "3.10" | ||
tox-env: py310-aws | ||
- python-version: "3.11" | ||
tox-env: py311-aws | ||
- python-version: "3.12" | ||
tox-env: py312-aws | ||
- tox-env: py38-aws | ||
- tox-env: py39-aws | ||
- tox-env: py310-aws | ||
- tox-env: py311-aws | ||
- tox-env: py312-aws | ||
|
||
- python-version: "3.7" | ||
tox-env: py37-unixsocket | ||
OVERRIDE_SKIP_CI_TESTS: True | ||
- python-version: "3.8" | ||
tox-env: py38-unixsocket | ||
- tox-env: py38-unixsocket | ||
OVERRIDE_SKIP_CI_TESTS: True | ||
- python-version: "3.9" | ||
tox-env: py39-unixsocket | ||
- tox-env: py39-unixsocket | ||
OVERRIDE_SKIP_CI_TESTS: True | ||
- python-version: "3.10" | ||
tox-env: py310-unixsocket | ||
- tox-env: py310-unixsocket | ||
OVERRIDE_SKIP_CI_TESTS: True | ||
- python-version: "3.11" | ||
tox-env: py311-unixsocket | ||
- tox-env: py311-unixsocket | ||
OVERRIDE_SKIP_CI_TESTS: True | ||
- python-version: "3.12" | ||
tox-env: py312-unixsocket | ||
- tox-env: py312-unixsocket | ||
OVERRIDE_SKIP_CI_TESTS: True | ||
|
||
- python-version: "3.7" | ||
tox-env: py37-apache | ||
- python-version: "3.8" | ||
tox-env: py38-apache | ||
- python-version: "3.9" | ||
tox-env: py39-apache | ||
- python-version: "3.10" | ||
tox-env: py310-apache | ||
- python-version: "3.11" | ||
tox-env: py311-apache | ||
- python-version: "3.12" | ||
tox-env: py312-apache | ||
- tox-env: py38-apache | ||
- tox-env: py39-apache | ||
- tox-env: py310-apache | ||
- tox-env: py311-apache | ||
- tox-env: py312-apache | ||
|
||
- python-version: "3.7" | ||
tox-env: py37-azureblob | ||
- python-version: "3.8" | ||
tox-env: py38-azureblob | ||
- python-version: "3.9" | ||
tox-env: py39-azureblob | ||
- python-version: "3.10" | ||
tox-env: py310-azureblob | ||
- python-version: "3.11" | ||
tox-env: py311-azureblob | ||
- python-version: "3.12" | ||
tox-env: py312-azureblob | ||
|
||
|
||
- python-version: "3.10" | ||
tox-env: flake8 | ||
- python-version: "3.10" | ||
tox-env: docs | ||
- tox-env: py38-azureblob | ||
- tox-env: py39-azureblob | ||
- tox-env: py310-azureblob | ||
- tox-env: py311-azureblob | ||
- tox-env: py312-azureblob | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
- name: Set up the latest version of uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
enable-cache: true | ||
cache-dependency-glob: "pyproject.toml" | ||
- name: Install dependencies | ||
run: | | ||
uv tool install --python-preference only-managed --python 3.12 tox --with tox-uv | ||
- name: Build | ||
env: | ||
TOXENV: ${{ matrix.tox-env }} | ||
OVERRIDE_SKIP_CI_TESTS: ${{ matrix.OVERRIDE_SKIP_CI_TESTS }} | ||
run: uvx --with tox-uv tox run | ||
- name: Upload coverage to Codecov | ||
if: ${{ matrix.tox-env != 'flake8' && matrix.tox-env != 'docs' }} | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Cache pip | ||
uses: actions/cache@v4 | ||
fail_ci_if_error: true | ||
verbose: true | ||
others: | ||
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
matrix: | ||
include: | ||
- tox-env: flake8 | ||
- tox-env: docs | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up the latest version of uv | ||
uses: astral-sh/setup-uv@v5 | ||
with: | ||
# This path is specific to Ubuntu | ||
path: ~/.cache/pip | ||
# Look to see if there is a cache hit for the corresponding requirements files | ||
key: ${{ format('{0}-pip-{1}', runner.os, hashFiles('dev-requirements.txt', format('requirements{0}.txt', matrix.spark-version-suffix))) }} | ||
enable-cache: true | ||
cache-dependency-glob: "pyproject.toml" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip 'tox<4.0' | ||
uv tool install --python-preference only-managed --python 3.12 tox --with tox-uv | ||
- name: Build | ||
env: | ||
TOXENV: ${{ matrix.tox-env }} | ||
OVERRIDE_SKIP_CI_TESTS: ${{ matrix.OVERRIDE_SKIP_CI_TESTS }} | ||
run: tox | ||
run: uvx --with tox-uv tox run | ||
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. The step just below this line includes a conditional to not run coverage upload if flake8 or docs. But this "others" matrix only includes flake8 and docs. Could we then remove its 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. fixed in 48650b7 |
||
- name: Upload coverage to Codecov | ||
if: ${{ matrix.tox-env != 'flake8' && matrix.tox-env != 'docs' }} | ||
uses: codecov/codecov-action@v5 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -172,3 +172,5 @@ Icon | |
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
.python-version |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,5 @@ python: | |
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- readthedocs |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
For maintainers of Luigi, who have push access to pypi. Here's how you upload | ||
Luigi to pypi. | ||
|
||
#. Make sure [twine](https://pypi.org/project/twine/) is installed ``pip install twine``. | ||
#. Update version number in `luigi/__meta__.py`. | ||
#. Make sure [uv](https://github.com/astral-sh/uv) is installed ``curl -LsSf https://astral.sh/uv/install.sh | sh``. | ||
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. Here we suggest to install uv with curl+sh, but in 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. fixed in 6f8a76f |
||
#. Update version number in `luigi/__version__.py`. | ||
dlstadther marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#. Commit, perhaps simply with a commit message like ``Version x.y.z``. | ||
#. Push to GitHub at [spotify/luigi](https://github.com/spotify/luigi). | ||
#. Clean up previous distributions by executing ``rm -rf dist`` | ||
#. Build a source distribution by executing ``python setup.py sdist`` | ||
#. Upload to pypi by executing ``twine upload dist/*`` | ||
#. Clean up previous distributions by executing ``rm -rf dist``. | ||
#. Build a source distribution by executing ``uv build``. | ||
#. Set pypi token on environment variable ``export UV_PUBLISH_TOKEN="LUIGI_PYPI_TOKEN_HERE"``. | ||
#. Upload to pypi by executing ``uv publish``. | ||
dlstadther marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#. Add a tag on github (https://github.com/spotify/luigi/releases), | ||
including a handwritten changelog, possibly inspired from previous notes. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,10 @@ def _warn_node(self, msg, node, *args, **kwargs): | |
|
||
sphinx.environment.BuildEnvironment.warn_node = _warn_node | ||
|
||
if os.environ.get('READTHEDOCS', None) == 'True': | ||
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org | ||
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. Before merging, we'll need to identify how to verify the merging of the final version of this branch doesn't break Luigi's readthedocs. 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. @hirosassa , how you thought how we can be sure that we don't break RTD when merging this PR? 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 think it is a little bit difficult because it depends on webhook of this repo. |
||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True' | ||
|
||
if on_rtd: | ||
# Run sphinx-apidoc automatically in readthedocs | ||
# Taken from this: https://lists.torproject.org/pipermail/tor-commits/2012-September/046695.html | ||
os.system('sphinx-apidoc -o api -T ../luigi --separate') | ||
|
@@ -83,7 +86,7 @@ def _warn_node(self, msg, node, *args, **kwargs): | |
# -- General configuration ------------------------------------------------ | ||
|
||
# If your documentation needs a minimal Sphinx version, state it here. | ||
needs_sphinx = '1.4.4' # Value mirrored in doc/conf.py | ||
needs_sphinx = '1.4.4' # Value mirrored in pyproject.toml | ||
|
||
# Add any Sphinx extension module names here, as strings. They can be | ||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom | ||
|
@@ -167,9 +170,6 @@ def _warn_node(self, msg, node, *args, **kwargs): | |
# The theme to use for HTML and HTML Help pages. See the documentation for | ||
# a list of builtin themes. | ||
|
||
# on_rtd is whether we are on readthedocs.org, this line of code grabbed from docs.readthedocs.org | ||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True' | ||
|
||
if not on_rtd: # only import and set the theme if we're building docs locally | ||
try: | ||
import sphinx_rtd_theme | ||
|
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.
I'm a bit confused how the CI is working know to use the correct python version for each tox environment. Could you help me understand why we use py 3.12 to install tox, but expect the correct python version to run the specific tox environment tests? Are there details within
tox-uv
that handle this?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.
Yes, you are right.
ref: https://github.com/tox-dev/tox-uv
if you run
uvx --with tox-uv tox -e py311
then we can see the log below:$ uvx --with tox-uv tox -e py311 py311: uv-sync> uv sync --frozen --python-preference system --no-dev -p cpython3.11 ...
At the first line of the log shows constructing process of Python 3.11 environment.