-
Notifications
You must be signed in to change notification settings - Fork 0
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
build: use pyproject.toml to declare configs #112
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
6c1da52
build: use pyproject.toml to declare configs
jsstevenson b1b7ae2
oops
jsstevenson 4265283
update
jsstevenson 7e56d7e
cicd
jsstevenson 33a927c
???
jsstevenson 8e166c5
more
jsstevenson 88c43ba
more ci/cd
jsstevenson a9510a7
fix ugh
jsstevenson 4764f67
run all hooks
jsstevenson a815350
add notes
jsstevenson 0e9bd6b
for kicks
jsstevenson a20eafc
revert
jsstevenson 20353c4
update version
jsstevenson 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: checks | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
name: test build py${{ matrix.python-version }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12", "3.13"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "${{ matrix.python-version }}" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install ".[tests]" | ||
|
||
# TODO -- build CI-ready unit tests | ||
|
||
lint: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
|
||
- name: Install dependencies | ||
run: python3 -m pip install ".[dev]" | ||
|
||
- name: Check style | ||
run: python3 -m flake8 src tests | ||
|
||
precommit_hooks: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
cmd: | ||
- "check-ast" | ||
- "debug-statements" | ||
- "end-of-file-fixer" | ||
- "trailing-whitespace" | ||
- "mixed-line-ending" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
|
||
- uses: pre-commit/action@v3.0.1 | ||
with: | ||
extra_args: ${{ matrix.cmd }} --all-files |
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,50 @@ | ||
# https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ | ||
name: Publish Python distribution to PyPI | ||
|
||
on: | ||
release: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
name: Build distribution | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
publish-to-pypi: | ||
name: >- | ||
Publish Python distribution to PyPI | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/vrs_anvil_toolkit | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 |
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,79 @@ | ||
[project] | ||
name = "vrs_anvil_toolkit" | ||
authors = [ | ||
{"name" = "GKS-AnVIL"} | ||
] | ||
readme = "README.md" | ||
classifiers = [ | ||
"Development Status :: 3 - Alpha", | ||
"Intended Audience :: Science/Research", | ||
"Intended Audience :: Developers", | ||
"Topic :: Scientific/Engineering :: Bio-Informatics", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
"Programming Language :: Python :: 3.13", | ||
] | ||
requires-python = ">=3.10" | ||
description = "Useful tools and methods for applying GA4GH GKS and VRS models on the NHGRI AnVIL platform." | ||
license = {file = "LICENSE.md"} | ||
dependencies = [ | ||
"ga4gh.vrs[extras]==2.0.0a13", | ||
"diskcache", | ||
"biocommons.seqrepo", | ||
"glom", | ||
"click", | ||
"pyyaml", | ||
"google", | ||
"requests", | ||
"boto3", | ||
"tqdm", | ||
"google-cloud-storage", | ||
"psutil", | ||
# for CAF generation: | ||
"firecloud", | ||
"ga4gh.va_spec~=0.2.0a0", | ||
"pandas", | ||
"vrsix==0.1.1", | ||
] | ||
dynamic = ["version"] | ||
|
||
[project.optional-dependencies] | ||
tests = [ | ||
"pytest", | ||
] | ||
dev = [ | ||
"flake8", | ||
"black", | ||
"pre-commit>=4.0.1", | ||
] | ||
|
||
[project.urls] | ||
Homepage = "https://github.com/gks-anvil/vrs_anvil_toolkit" | ||
Documentation = "https://github.com/gks-anvil/vrs_anvil_toolkit" | ||
quinnwai marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Changelog = "https://github.com/gks-anvil/vrs_anvil_toolkit/releases" | ||
Source = "https://github.com/gks-anvil/vrs_anvil_toolkit" | ||
"Bug Tracker" = "https://github.com/gks-anvil/vrs_anvil_toolkit/issues" | ||
|
||
[project.scripts] | ||
vrs_bulk = "vrs_anvil.cli:cli" | ||
|
||
[build-system] | ||
requires = ["setuptools>=64", "setuptools_scm>=8"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
|
||
[tool.setuptools.package-data] | ||
vrs_anvil_toolkit = ["**/*.yaml"] | ||
|
||
[tool.setuptools_scm] | ||
|
||
[tool.pytest.ini_options] | ||
filterwarnings = ["ignore::DeprecationWarning"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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.
preempted my thoughts here: would it be an easy win to add the current unit tests (
pytest tests/unit
) to the CI in this PR? Or were you considering it out of scope for the current PRThere 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 didn't think too hard about how nontrivial it would be to get these working, but I think there's still some configuration that would have to happen for the CI instance to be able to run them. Here's an example run trying every test: https://github.com/gks-anvil/vrs_anvil_toolkit/actions/runs/13637983594/job/38121227703
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.
okay fair enough, we can make it out of scope then. I think the main problem is the supposed "unit tests" we created are pointing to an already downloaded seqrepo dir when testing occurs. Not sure how you do it in vrs-python but would be inclined to do it that same way.
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.
Ah yeah. For SeqRepo, we use the REST dataproxy in tests and then use something like pytest vcr to capture + stash the HTTP requests so that they can be used during CI/CD. It's a little painful but it works. I can make another issue to work that out.