Skip to content

try to get dynamic version in pyproject.toml #155

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

Open
drbenvincent opened this issue Jan 6, 2023 · 3 comments
Open

try to get dynamic version in pyproject.toml #155

drbenvincent opened this issue Jan 6, 2023 · 3 comments
Labels
devops DevOps related good first issue Good for newcomers

Comments

@drbenvincent
Copy link
Collaborator

AFTER #105...

In theory we should be able to have ONE version number in causalpy/version.py and get pyproject.toml to extract that. See the instructions here, https://packaging.python.org/en/latest/guides/single-sourcing-package-version/

But when working on #105 this was not working. So at the moment we have the version number in both causalpy/version.py and and pyproject.toml.

@OriolAbril
Copy link
Contributor

OriolAbril commented Jan 20, 2023

I use flit in xarray-einstats and the dynamic version is working: https://github.com/arviz-devs/xarray-einstats/blob/main/pyproject.toml. (I used https://github.com/astrojuanlu/cookiecutter-pylib as template in case it helps, I don't really have any idea about the options available nor the pros/cons of each but it worked so I went with it)

@jpreszler
Copy link
Contributor

I first tried to get setuptools to work, but the imports in __init__.py caused issues (either pip install -e . would fail with missing modules, or it would finish but the usage of the package would need to change, i.e. result = cp.pymc_experiment.SyntheticControl(...) wouldn't work).

Changing to flit, based on the above suggestion seems to work with minimal changes but I'm not sure show to test besides pip install -e . and python -m build and checking.

Also it seems @drbenvincent and @lucianopaz didn't like a previous attempt that changed the build system to setuptools-scm. It seems the same issues don't apply to Flit, but there could be other concerns.

@drbenvincent
Copy link
Collaborator Author

There is also bump2version as a possibility.

@drbenvincent drbenvincent added the good first issue Good for newcomers label Jun 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops DevOps related good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants