-
-
Notifications
You must be signed in to change notification settings - Fork 212
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
Using use_scm_version
write_to
in setup.cfg
#582
Comments
use_scm_version={"write_to": f"{name}/_version.py"}
in setup.cfg
use_scm_version
write_to
in setup.cfg
There may be a workaround: in from setuptools import setup
from setuptools.config import read_configuration
conf_dict = read_configuration("setup.cfg")
PKG_NAME = conf_dict['metadata']['name']
setup(
use_scm_version={"write_to": f"{PKG_NAME}/_version.py"},
) Therefore moving the |
…single configuration file for all metadata.
use configuring |
So basically what you're saying is that I should place
in pyproject.toml. Well this is great but that does not solve my problem :( since the pkg name has to be written twice: once here in the Maybe supporting a Until such a solution is available, for those developers wishing to avoid entering the same folder name twice in two different configuration files, the workaround above seems to work. I tested it on https://github.com/smarie/python-genbadge and both in dev and release mode it works. Thanks again @RonnyPfannschmidt ! |
I love setuptools_scm, I use it in all my libs. I find the
write_to
option a great way to have the package find its own__version__
, using the trick described here.I adopted last year a practice to place most of the setup information in
setup.cfg
, it seems to work very well (following this great example)Until now I was always still placing
use_scm_version={"write_to": f"{name}/_version.py"}
in thesetup.py
because it was not supported insetup.cfg
. However thename
had to be inserted in both files, which is not convenient (For example: here in setup.py and here in setup.cfg).Digging aroung in the past issues and PR I found #364 and #181 So I thought that maybe the status had evolved now ? Can I now use
in setup.cfg ? If this is not the recommended way, let me know !
Thanks a lot
The text was updated successfully, but these errors were encountered: