-
-
Notifications
You must be signed in to change notification settings - Fork 221
setuptools_scm does not work with setup.cfg #181
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
Comments
thats pretty much a setuptools bug, |
@jaraco how would that one best be integrated? |
@idlesign could you also take a look at this plz? |
@1oglop1 Please show your I've tried the following, and it seems to work:
|
@idlesign you probably misunderstood the problem:
[options]
use_scm_version = True
setup_requires =
setuptools_scm
I'd suggest adding type specifiers to the config reader in |
What kind of integration? I undertand the ultimate goal of |
AFAICS, the description above is the official way of enabling |
May be I'm missing some use case, but as it is I see no reason to complicate things. @RonnyPfannschmidt, anything that prevents your users from using |
Okay.. But what about lazy loading of attrs? I guess this must be solved before it's usable, right? |
Almost. It's usable already if you're lucky to have Yet, I have some tweaks in mind for
|
thanks, I'll be waiting for lazyness updates :) |
@idlesign the main problem is lack of support in setuptools, until it is added no can do, |
With an additional patch to pypa/setuptools#1150: setuptools/dist.py | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git i/setuptools/dist.py w/setuptools/dist.py
index b51e9cb2..a2a4406a 100644
--- i/setuptools/dist.py
+++ w/setuptools/dist.py
@@ -369,7 +367,7 @@ class Distribution(Distribution_parse_config_files, _Distribution):
None in (self.dependency_links, self.setup_requires)
):
dist = self.__class__()
- dist.parse_config_files()
+ dist.parse_config_files(ignore_option_errors=True)
if self.setup_requires is None:
self.setup_requires = dist.setup_requires
if self.dependency_links is None:
@@ -445,14 +443,15 @@ class Distribution(Distribution_parse_config_files, _Distribution):
req.marker = None
return req
- def parse_config_files(self, filenames=None):
+ def parse_config_files(self, filenames=None, ignore_option_errors=False):
"""Parses configuration files from various levels
and loads configuration.
"""
_Distribution.parse_config_files(self, filenames=filenames)
- parse_configuration(self, self.command_options)
+ parse_configuration(self, self.command_options,
+ ignore_option_errors=ignore_option_errors)
self._finalize_requires()
def parse_command_line(self):
@@ -515,7 +514,7 @@ class Distribution(Distribution_parse_config_files, _Distribution):
"""Fetch an egg needed for building"""
from setuptools.command.easy_install import easy_install
dist = self.__class__({'script_args': ['easy_install']})
- dist.parse_config_files()
+ dist.parse_config_files(ignore_option_errors=True)
opts = dist.get_option_dict('easy_install')
keep = (
'find_links', 'site_dirs', 'index_url', 'optimize', This seem to work: from setuptools import setup
setup(name='project') [metadata]
version = attr: setuptools_scm.get_version
[options]
setup_requires =
setuptools_scm |
I amended pypa/setuptools#1150 to support the above use-case. |
@benoit-pierre kinda a complete no-go at first glance |
Any updates on this? |
@webknjaz nothing about this has happened on the setuptools side |
I was debuging the behaviour of
setuptools_scm
because I received exception from functionversion_keyword
in
setuptools
fileconfig.py
, all options go through parser except additional options likeuse_scm_version
, I guess this should be handled bysetuptools_scm
file :
setuptools/config.py
in
setuptools_scm
something goes wrong here:
because function
version_keyword
receives parametervalue
asstr
but that function expectsbool
- because the value did not go through the parsing processwhat I do not know is how that
version_keyword
is calledThe text was updated successfully, but these errors were encountered: