-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add pyproject.toml and packaging config #10
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bf8251e
Add pyproject.toml and package build, use uv to run CI checks
luizirber fbbc227
add publish task to check if package builds properly
luizirber 285edd7
Add coverage as dev dep
luizirber 724f288
use uv for docs building in CI
luizirber 5512fe0
use 3.12 consistently
luizirber a4e81f2
comment on testing vs docs dev deps
luizirber File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -27,16 +27,17 @@ jobs: | |
token: ${{ secrets.GITHUB_TOKEN }} | ||
submodules: recursive | ||
|
||
- name: Setting up Python 3.12 (${{ matrix.os }}) | ||
uses: actions/setup-python@v5 | ||
- name: Install a specific version of uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
python-version: "3.12" | ||
version: "0.4.x" | ||
enable-cache: true | ||
|
||
- name: Installing dtspy dependencies (${{ matrix.os }}) | ||
run: python3 -m pip install -r requirements.txt | ||
- name: Install Python 3.12 | ||
run: uv python install 3.12 | ||
|
||
- name: Running tests (${{ matrix.os }}) | ||
run: coverage run -m unittest discover | ||
run: uv run --dev coverage run -m unittest discover | ||
env: | ||
DTS_KBASE_DEV_TOKEN: ${{ secrets.DTS_KBASE_DEV_TOKEN }} | ||
|
||
|
@@ -46,3 +47,33 @@ jobs: | |
# uses: codecov/[email protected] | ||
# with: | ||
# token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
# Steps for running tests and analysis. | ||
steps: | ||
- name: Checking out repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
submodules: recursive | ||
|
||
- name: Install a specific version of uv | ||
uses: astral-sh/setup-uv@v3 | ||
with: | ||
version: "0.4.x" | ||
enable-cache: true | ||
|
||
- name: Install Python 3.12 | ||
run: uv python install 3.12 | ||
|
||
- name: Build package | ||
run: uv build | ||
|
||
- name: Check package can be imported | ||
run: uv run --with dist/dtspy-*-py3-none-any.whl --no-project -- python -c "import dts" | ||
|
||
# when ready to upload to PyPI | ||
# name: upload to PyPI | ||
# run: uv publish |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
3.12 |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[build-system] | ||
requires = ["setuptools >= 61.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
name = "dtspy" | ||
version = "0.1.0" | ||
description = "Python client for the Data Transfer Service" | ||
authors = [ | ||
{ name = "Jeffrey N. Johnson", email = "[email protected]" }, | ||
] | ||
readme = "README.md" | ||
requires-python = ">=3.12" | ||
dependencies = [ | ||
"frictionless>=5.17.0,<6", | ||
"requests>=2.32.3,<3", | ||
] | ||
|
||
[tool.uv] | ||
dev-dependencies = [ | ||
# testing | ||
"coverage >=7.6.3,<8", | ||
|
||
# docs | ||
"mkdocs-material>=9.5.41", | ||
"mkdocs>=1.6.1", | ||
"mkdocstrings-python>=1.12.1", | ||
"mkdocstrings>=0.26.2", | ||
] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
have you tried running dtspy from a clean py3.12 install? The requirements file is quite long - are these the only two deps? I hope that the testing and doc generation aren't responsible for all the rest!
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.
These two are the top-level dependencies, most of the ones listed in the requirements file come from them indirectly.
To see the equivalent
requirements.txt
based on the uv lock file, you can runuv pip compile pyproject.toml
(and maybe add
--no-annotate
to make it easier to diff with currentrequirements.txt
)But yes, there are many that are testing/doc deps...
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.
And I'm already using as a dep in a project with
which points to this PR, and it is all working