Skip to content
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

Version number prints incorrectly #12

Closed
johnkerl opened this issue Jul 10, 2024 · 9 comments · Fixed by #16
Closed

Version number prints incorrectly #12

johnkerl opened this issue Jul 10, 2024 · 9 comments · Fixed by #16
Assignees

Comments

@johnkerl
Copy link
Collaborator

After conda-install in TileDB Cloud we see

import cellxgene_census
print(cellxgene_census.__version__)
 'cellxgene_census': '0.1.dev1+g54893c9.d20240617'}```

The code itself is OK -- it seems the version-printer is not.

@johnkerl johnkerl self-assigned this Jul 10, 2024
@johnkerl
Copy link
Collaborator Author

johnkerl commented Jul 10, 2024

I need to assign this to @jdblischak but he's not in this repo -- I'll add him

@jdblischak
Copy link
Collaborator

I confirmed the problem locally:

# PyPI
python -m venv ./cellxgene
./cellxgene/bin/python -m pip install cellxgene-census
## Collecting cellxgene-census
##   Downloading cellxgene_census-1.14.1-py3-none-any.whl (47 kB)
./cellxgene/bin/python -c "import cellxgene_census; print(cellxgene_census.__version__)"
## 1.14.1

# conda
mamba create --yes -n cellxgene -c conda-forge -c tiledb python=3.9 cellxgene-census
## + cellxgene-census                        1.14.1  pyh4471522_0            tiledb            43kB
mamba activate cellxgene
python -c "import cellxgene_census; print(cellxgene_census.__version__)"
## 0.1.dev1+g54893c9.d20240617

@jdblischak
Copy link
Collaborator

jdblischak commented Jul 10, 2024

I suspect this is a setuptools-scm issue like we've seen previously for TileDB-VCF.

The Python package uses a dynamic version via setuptools-scm:

[build-system]
requires = ["setuptools>=64", "setuptools_scm[toml]>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "cellxgene-census"
dynamic = ["version"]

And the conda recipe downloads the PyPI source tarball, which has no Git repo associated with it:

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ last_name }}-{{ version }}.tar.gz

But the PyPI source tarball does include a PKG-INFO that has the correct version specified. And when I install the source tarball locally (ie with no Git repository), it gets the version correct, so why doesn't the same thing happen during the conda build?

wget https://pypi.io/packages/source/c/cellxgene-census/cellxgene_census-1.14.1.tar.gz
python -m venv ./cellxgene-source
./cellxgene-source/bin/python -m pip install cellxgene_census-1.14.1.tar.gz
## Building wheels for collected packages: cellxgene-census
##   Building wheel for cellxgene-census (pyproject.toml) ... done
##   Created wheel for cellxgene-census: filename=cellxgene_census-1.14.1-py3-none-any.whl size=47383 sha256=eb2265dcb98ef741f823193785d09a0fc76295bc705c6c4c286475600ea12b54
./cellxgene-source/bin/python -c "import cellxgene_census; print(cellxgene_census.__version__)"
## 1.14.1

@johnkerl
Copy link
Collaborator Author

@jdblischak weerd

I don't know much about this -- at all! -- happy to dig in from scratch if it helps ...

I would note that tiledbsoma (IIRC) we solved the same problem ...

@jdblischak
Copy link
Collaborator

SOMA doesn't use setuptools-scm. It uses a bespoke version.py. I'll continue investigating tomorrow. Worst case we can update this recipe to pull directly from the GitHub repo. It's not on conda-forge, so we can be more flexible.

@johnkerl
Copy link
Collaborator Author

Oh nuts, sorry @jdblischak ! @nguyenv and/or @thetorpedodog may know more off top head than I do.

@johnkerl
Copy link
Collaborator Author

johnkerl commented Nov 7, 2024

❤️

@jdblischak
Copy link
Collaborator

Confirming that the newly uploaded conda binary works as expected. TileDB Cloud will be updated the next time the Docker image is rebuilt.

mamba create --yes -n cellxgene-census-version \
  -c conda-forge -c tiledb --override-channels \
  cellxgene-census=1.15.0=pyh4471522_2
mamba activate cellxgene-census-version
python -c 'import cellxgene_census; print(cellxgene_census.__version__)'
## 1.15.0

@johnkerl
Copy link
Collaborator Author

johnkerl commented Nov 7, 2024

❤️❤️ Thank you @jdblischak !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants