-
Notifications
You must be signed in to change notification settings - Fork 1
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
Single location for package version number. #29
Conversation
This makes sense to me. It may be possible to centralize version metadata in pyproject.toml, but that is contingent on using Python >= 3.8. Likewise making it available from Sphinx requires either reading the correct TOML field yourself or a third-party library like https://github.com/sphinx-toolbox/sphinx-pyproject. |
Updated conf.py to point to the correct ```src``` folder.
PEP8: solving - E402 module level import not at top of file
I found that this solution is creating a bit of a problem if you want to use it without installing the package editable or not. |
It seems that a possible cleaner solution would be to integrate Sphinx with setup.cfg directly |
The simplest solution if we decide to keep a top level package is to include Not completely sure if we would like to go for a top-level package template. If that's the decision we could keep this. If we vote for not keeping a top-level package we still should include the conf.py in the exclusion list of flake8, and point to "../src" instead of ".." (I believe that is a typo in the current version of If not top-level package then setup.cfg o pyproject.toml , needs to share the version with sphinx. |
Setuptools integration is deprecated, and I think we're converging on a solution in #30. Closing this for now and we can reopen if the other solution doesn't pan out. |
The current package version is repeated across setup.cfg and sphinx/conf.py configuration.
This creates developer overhead by sync and updating both files while creating documentation and/or packaging.
Suggestion:modify package version should be in just one place and have sphinx and setup.cfg sync with it.
The proposal is to place the
__version___
value it in the__init__.py
file of the default top-level package name. Accessible by:{{ cookiecutter.package_name }}.__version__
Note: this issue has been combined with creating a top level package folder (Issue #6). Necessary for easy access form setup.cfg and sphinx/conf.py.
Changes:
Create cookiecutter variable
{{ cookiecutter.package_name }}
by replacing "-" for "_" from project name.No sure if that's the most secure way. Let's discuss about it
Create a {{ cookiecutter.package_name }}.init.py with content
Modify setup.cfg to read version from
attr: {{ cookiecutter.package_name }}.__version__
Modify conf.py to import
{{ cookiecutter.package_name }}`` and read version from
{{ cookiecutter.package_name }}.version```Closes #6
@ToucheSir FYI, brainstorming if there could be an improvement to this feature