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

set version using importlib rather than expecting hard-coded #64

Closed
cameronraysmith opened this issue Feb 18, 2023 · 0 comments · Fixed by #96
Closed

set version using importlib rather than expecting hard-coded #64

cameronraysmith opened this issue Feb 18, 2023 · 0 comments · Fixed by #96
Assignees
Labels
bug Something isn't working python Pull requests that update Python code
Milestone

Comments

@cameronraysmith
Copy link
Collaborator

cameronraysmith commented Feb 18, 2023

from . import __version__

expects the __version__ variable, which can be hard-coded in __init__.py or determined using importlib as in python-poetry/poetry#273 (comment). The latter is preferable to avoid a requirement for multiple updates on release that arises with the former.

importlib.metadata.version
from importlib import metadata

__version__ = metadata.version(__package__)

del metadata  # avoids polluting dir(__package__)
@cameronraysmith cameronraysmith added bug Something isn't working python Pull requests that update Python code labels Feb 18, 2023
@cameronraysmith cameronraysmith added this to the packaging milestone Feb 18, 2023
@cameronraysmith cameronraysmith self-assigned this Feb 18, 2023
@cameronraysmith cameronraysmith modified the milestones: packaging, 0.1.2 Mar 16, 2023
cameronraysmith added a commit to cameronraysmith/pyrovelocity that referenced this issue Apr 1, 2023
* python-poetry/poetry#273 (comment)
* set version using importlib rather than expecting hard-coded pinellolab#64
cameronraysmith added a commit that referenced this issue Apr 2, 2023
* add application conda env

* add application dockerfile

* update Makefile to build application

* add application styling

* remove flake8 config file

* remove darglint config file

* set version from importlib

* python-poetry/poetry#273 (comment)
* set version using importlib rather than expecting hard-coded #64

* update application dockerfile to install library

* update application environment

* gcs
* simplify library install by installing leidenalg and astropy from conda

* add make target for shell in running container

* download app data from gcs
cameronraysmith added a commit that referenced this issue Jan 3, 2024
* add application conda env

* add application dockerfile

* update Makefile to build application

* add application styling

* remove flake8 config file

* remove darglint config file

* set version from importlib

* python-poetry/poetry#273 (comment)
* set version using importlib rather than expecting hard-coded #64

* update application dockerfile to install library

* update application environment

* gcs
* simplify library install by installing leidenalg and astropy from conda

* add make target for shell in running container

* download app data from gcs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working python Pull requests that update Python code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant