Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# setuptools_scm derives the version from the git tag, so the tags
# (and history) must be present - singlem/version.py is no longer
# committed.
fetch-depth: 0
- uses: actions/setup-python@v2
# admin/requirements.txt is tracked only as a stub; the real pinned
# contents are generated here from pixi.toml/pixi.lock so setuptools
Expand Down
13 changes: 7 additions & 6 deletions admin/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@

print("Building dependency definition files based on pixi.toml and pixi.lock") # TODO: Do we need to update pixi.lock first?
extern.run('pixi run admin/build_dep_defs_from_pixi.py')
# admin/requirements.txt is only tracked as a stub - committing the pinned
# versions makes future `pixi update` runs unsolvable, because the pins
# conflict with the fresh conda solve. CI regenerates the pinned file from
# pixi.lock before building the wheel.
extern.run('git checkout -- admin/requirements.txt')

print("building docs")
extern.run("pixi run python3 admin/build_docs.py --version {}".format(version))
Expand All @@ -40,12 +45,8 @@
)
extern.run('if [[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]]; then exit 1; fi')

# Generate the version file based on the git tag
extern.run("pixi run -e dev bash -c 'SETUPTOOLS_SCM_PRETEND_VERSION={} python -m setuptools_scm --force-write-version-files'".format(version))

print("Committing the version file")
extern.run('git commit -a -m "v{}"'.format(version))

# No version file is committed - singlem/__init__.py reads the installed
# package metadata, which setuptools_scm derives from the tag below.
print("Tagging the release as v{}".format(version))
extern.run('git tag v{}'.format(version))

Expand Down
21 changes: 4 additions & 17 deletions admin/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,4 @@
# This file was autogenerated by build_dep_defs_from_pixi.py - do not change manually.
biopython==1.87
bird_tool_utils==0.6.0
extern==0.4.1
fastalite
graftm==0.15.1
Jinja2==3.1.6
pip==26.1.1
polars==1.40.1
pyarrow==24.0.0
pyranges==0.1.4
seqmagick==0.8.6
SQLAlchemy==2.0.49
sqlparse==0.5.5
squarify==0.4.3
tqdm==4.67.3
zenodo_backpack==0.4.0
# Stub file — pyproject.toml requires this to exist for setuptools to read
# `[project].dependencies`. The real contents are generated from pixi.toml
# and pixi.lock by admin/build_dep_defs_from_pixi.py, which runs locally
# during release and in CI before the PyPI build. Do not edit by hand.
8,172 changes: 4,571 additions & 3,601 deletions pixi.lock

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,8 @@ include-package-data = true
dependencies = { file = ["admin/requirements.txt"] }

[tool.setuptools_scm]
version_file = "singlem/version.py"
# Otherwise the push to pypi will fail on GitHub actions, because the version is malformed.
version_scheme = "only-version"
version_scheme = "guess-next-dev"
local_scheme = "no-local-version"

[tool.uv.sources]
Expand Down
10 changes: 9 additions & 1 deletion singlem/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@

from .version import __version__
try:
from importlib.metadata import version as _pkg_version, PackageNotFoundError
__version__ = _pkg_version("singlem")
except (ImportError, PackageNotFoundError):
# Either python <3.8, which has no importlib.metadata, or singlem was
# imported from a source tree that has never been built or installed, so
# there is no distribution metadata to read. setuptools_scm no longer
# writes singlem/version.py, so there is nothing to fall back to.
__version__ = 'unknown'

OTU_TABLE_OUTPUT_FORMAT = 'standard'
ARCHIVE_TABLE_OUTPUT_FORMAT = 'archive'
Expand Down
34 changes: 0 additions & 34 deletions singlem/version.py

This file was deleted.

Loading