-
Notifications
You must be signed in to change notification settings - Fork 8
Update packaging: pyproject.toml, new deploy workflow #47
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
Open
C-Achard
wants to merge
4
commits into
main
Choose a base branch
from
cy/update-packaging-and-deploy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
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 hidden or 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,47 +1,54 @@ | ||
| name: Update release | ||
| name: Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*.*.*' | ||
| pull_request: | ||
| branches: | ||
| - main | ||
| types: | ||
| - labeled | ||
| - opened | ||
| - edited | ||
| - synchronize | ||
| - reopened | ||
| push: | ||
| tags: | ||
| - "v*.*.*" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| concurrency: | ||
| group: release-${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| release: | ||
| build-and-publish: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Cache dependencies | ||
| id: pip-cache | ||
| uses: actions/cache@v4 | ||
| - name: Check out source | ||
| uses: actions/checkout@v6 | ||
| with: | ||
| path: ~/.cache/pip | ||
| key: ${{ runner.os }}-pip | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Install dependencies | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v6 | ||
| with: | ||
| python-version: "3.12" | ||
| cache: "pip" | ||
|
|
||
| - name: Install build tooling | ||
| run: | | ||
| pip install --upgrade pip | ||
| pip install wheel twine | ||
| pip install "packaging>=24.2" | ||
| python -m pip install --upgrade pip | ||
| python -m pip install build twine setuptools-scm | ||
|
|
||
| - name: Show SCM-derived version | ||
| run: python -m setuptools_scm | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@v3 | ||
| - name: Build distributions | ||
| run: python -m build | ||
|
|
||
| - name: Build and publish to PyPI | ||
| if: ${{ github.event_name == 'push' }} | ||
| - name: Check built distributions | ||
| run: python -m twine check dist/* | ||
|
|
||
| - name: Publish to PyPI | ||
| if: startsWith(github.ref, 'refs/tags/v') | ||
| env: | ||
| TWINE_USERNAME: __token__ | ||
| TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }} | ||
| run: | | ||
| python3 setup.py sdist bdist_wheel | ||
| ls dist/ | ||
| tar tvf dist/dlclibrary-*.tar.gz | ||
| python3 -m twine upload dist/* | ||
| run: python -m twine upload --non-interactive dist/* |
This file contains hidden or 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
Empty file.
This file contains hidden or 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,13 +1,33 @@ | ||
| # | ||
| # DeepLabCut Toolbox (deeplabcut.org) | ||
| # © A. & M.W. Mathis Labs | ||
| # https://github.com/DeepLabCut/DeepLabCut | ||
| # | ||
| # Please see AUTHORS for contributors. | ||
| # https://github.com/DeepLabCut/DeepLabCut/blob/master/AUTHORS | ||
| # | ||
| # Licensed under GNU Lesser General Public License v3.0 | ||
| # | ||
|
|
||
| __version__ = "0.0.12" | ||
| VERSION = __version__ | ||
| # Backwards compatibility shim only. Consider deprecated. | ||
| import warnings | ||
|
|
||
| from . import __version__ as _PACKAGE_VERSION | ||
| from . import VERSION as _PACKAGE_VERSION_ALIAS | ||
|
|
||
| __all__ = ["__version__", "VERSION"] | ||
|
|
||
|
|
||
| def __getattr__(name): | ||
| if name == "__version__": | ||
| warnings.warn( | ||
| ( | ||
| "'dlclibrary.version.__version__' is deprecated and will be removed " | ||
| "in a future release. Use 'dlclibrary.__version__' instead." | ||
| ), | ||
| DeprecationWarning, | ||
| stacklevel=2, | ||
| ) | ||
| return _PACKAGE_VERSION | ||
|
|
||
| if name == "VERSION": | ||
| warnings.warn( | ||
| ( | ||
| "'dlclibrary.version.VERSION' is deprecated and will be removed " | ||
| "in a future release. Use 'dlclibrary.VERSION' instead." | ||
| ), | ||
| DeprecationWarning, | ||
| stacklevel=2, | ||
| ) | ||
| return _PACKAGE_VERSION_ALIAS | ||
|
|
||
| raise AttributeError(f"module {__name__!r} has no attribute {name!r}") |
This file contains hidden or 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,47 @@ | ||
| [build-system] | ||
| requires = [ | ||
| "setuptools>=80", | ||
| "setuptools-scm>=8", | ||
| "wheel", | ||
| ] | ||
| build-backend = "setuptools.build_meta" | ||
|
|
||
| [project] | ||
| name = "dlclibrary" | ||
| dynamic = ["version"] | ||
| description = "Lightweight library supporting universal functions for the DeepLabCut ecosystem" | ||
| readme = { file = "README.md", content-type = "text/markdown" } | ||
| authors = [ | ||
| { name = "The DeepLabCut team", email = "admin@deeplabcut.org" } | ||
| ] | ||
| license = { text = "GNU Lesser General Public License v3.0" } | ||
| requires-python = ">=3.9" | ||
| classifiers = [ | ||
| "Programming Language :: Python :: 3", | ||
| "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", | ||
| "Operating System :: OS Independent", | ||
| ] | ||
| dependencies = [ | ||
| "huggingface_hub>=0.11.1", | ||
| "ruamel.yaml>=0.15.0", | ||
| ] | ||
|
|
||
| [project.urls] | ||
| Homepage = "https://github.com/DeepLabCut/DLClib" | ||
| Repository = "https://github.com/DeepLabCut/DLClib" | ||
|
|
||
| [tool.setuptools] | ||
| include-package-data = false | ||
| license-files = ["LICENSE", "NOTICE.yml"] | ||
|
|
||
| [tool.setuptools.packages.find] | ||
| include = ["dlclibrary*"] | ||
|
|
||
| [tool.setuptools.package-data] | ||
| "dlclibrary.dlcmodelzoo" = [ | ||
| "*.yaml", | ||
| "*.json", | ||
| "superanimal_configs/*.yaml", | ||
| ] | ||
|
|
||
| [tool.setuptools_scm] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
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.
Uh oh!
There was an error while loading. Please reload this page.