-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from AllenNeuralDynamics/cdci-add-uv-support
Add support for uv package manager
- Loading branch information
Showing
6 changed files
with
831 additions
and
25 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
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,63 @@ | ||
name: Tag and Publish | ||
|
||
on: | ||
workflow_dispatch: {} | ||
|
||
jobs: | ||
tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.11 | ||
- uses: actions/checkout@v3 | ||
- name: Extract version from __init__.py and package name from pyproject.toml | ||
id: get_version_and_name | ||
run: | | ||
package_name=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['name'])") | ||
package_name=${package_name//-/_} | ||
version=$(python -c "import re; | ||
with open(f'./src/${package_name}/__init__.py', 'r') as f: | ||
content = f.read(); | ||
match = re.search(r'__version__\s*=\s*[\'\"]([^\'\"]+)[\'\"]', content); | ||
print(match.group(1)) if match else exit(1)") | ||
echo "PACKAGE_NAME=$package_name" >> $GITHUB_ENV | ||
echo "PACKAGE_VERSION=$version" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Create Git tag | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git tag -a v${{ env.PACKAGE_VERSION }} -m "v${{ env.PACKAGE_VERSION }}" | ||
git push origin v${{ env.PACKAGE_VERSION }} | ||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
token: ${{ secrets.SERVICE_TOKEN }} | ||
tag_name: v${{ env.PACKAGE_VERSION }} | ||
name: Release v${{ env.PACKAGE_VERSION }} | ||
generate_release_notes: true | ||
|
||
publish: | ||
needs: tag | ||
if: always() # Enable publishing | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Pull latest changes | ||
run: git pull origin ${{ env.DEFAULT_BRANCH }} | ||
- uses: astral-sh/setup-uv@v3 | ||
with: | ||
enable-cache: true | ||
|
||
- name: Set up Python | ||
run: uv python install | ||
|
||
- name: Build | ||
run: uv build | ||
|
||
- name: Publish | ||
run: uv publish --token ${{ secrets.AIND_PYPI_TOKEN }} |
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 @@ | ||
3.11 | ||
3.12 | ||
3.13 |
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 |
---|---|---|
|
@@ -5,25 +5,38 @@ build-backend = "setuptools.build_meta" | |
[project] | ||
name = "aind-behavior-core-analysis" | ||
description = "A library with core primitives for analysis shared across all `Aind.Behavior` tasks" | ||
authors = [ | ||
{ name = "Bruno Cruz", email = "[email protected]" }, | ||
] | ||
license = {text = "MIT"} | ||
requires-python = ">=3.11" | ||
|
||
classifiers = [ | ||
"Programming Language :: Python :: 3" | ||
"Programming Language :: Python :: 3.11", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: Microsoft :: Windows", | ||
] | ||
|
||
dynamic = ["version", "readme"] | ||
|
||
dependencies = [ | ||
'harp-python', | ||
'numpy<2.0.0', # numpy 2.0.0 is not supported by harp | ||
'aind_behavior_services>=0.8.0', | ||
'pyyaml', | ||
'requests', | ||
] | ||
|
||
[project.urls] | ||
Documentation = "https://allenneuraldynamics.github.io/Aind.Behavior.CoreAnalysis/" | ||
Repository = "https://github.com/AllenNeuralDynamics/Aind.Behavior.CoreAnalysis/" | ||
Issues = "https://github.com/AllenNeuralDynamics/Aind.Behavior.CoreAnalysis/issues" | ||
Changelog = "https://github.com/AllenNeuralDynamics/Aind.Behavior.CoreAnalysis/releases" | ||
|
||
|
||
[project.optional-dependencies] | ||
|
||
|
||
linters = [ | ||
dev = [ | ||
'ruff', | ||
'codespell' | ||
] | ||
|
@@ -53,5 +66,5 @@ mccabe = { max-complexity = 14 } | |
pydocstyle = { convention = 'google' } | ||
|
||
[tool.codespell] | ||
skip = '.git,*.pdf,*.svg,./bonsai,*.bonsai,./docs/_build,./build' | ||
skip = '.git,*.pdf,*.svg,./bonsai,*.bonsai,./docs/_build,uv.lock' | ||
ignore-words-list = 'nd' |
Oops, something went wrong.