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

fix: version string #101

Merged
merged 11 commits into from
Apr 5, 2023
Merged

fix: version string #101

merged 11 commits into from
Apr 5, 2023

Conversation

mattkram
Copy link
Contributor

@mattkram mattkram commented Apr 5, 2023

Fixes the dynamic loading of package version in the installed package.

We use setuptools-scm to write the version to the file src/conda_project/_version.py. This file is not to be checked into git.

We then dynamically import this file into the global conda_project.__version__.

This file will be generated both during pip install -e ., as well as when generating the source distribution for PyPI via python -m build.

If there is any error importing the _version.py file, the version number will be set to "unknown".

A test has been added to the conda recipe to ensure that the version of the built package is correct.

Also, clean up meta.yaml to align better with conda-forge recipe
@codecov
Copy link

codecov bot commented Apr 5, 2023

Codecov Report

Merging #101 (c0db254) into main (a0bab0f) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #101   +/-   ##
=======================================
  Coverage   96.63%   96.63%           
=======================================
  Files           9        9           
  Lines         742      742           
=======================================
  Hits          717      717           
  Misses         25       25           
Impacted Files Coverage Δ
src/conda_project/__init__.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@mattkram
Copy link
Contributor Author

mattkram commented Apr 5, 2023

Using a git archive doesn't seem to work, so I've reverted those changes: https://github.com/pypa/setuptools_scm#git-archives

However, I have confirmed that we can publish the source tarball to pypi.org and then build the conda package from that.

We may have an opportunity for some more work in the future to enable building the conda package from the released git tarball, but for now let's plan to build from pypi.org.

@mattkram mattkram enabled auto-merge (squash) April 5, 2023 18:01
@mattkram mattkram merged commit ad9cdb3 into main Apr 5, 2023
@mattkram mattkram deleted the fix/version-string branch April 5, 2023 23:12
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 this pull request may close these issues.

2 participants