Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-29 Thread Steve Kowalik
@s-t-e-v-e-n-k commented on this pull request. > @@ -143,10 +201,30 @@ def convert(name, operator, version_id): def normalize_name(name): """https://www.python.org/dev/peps/pep-0503/#normalized-names""; -import re Indeed -- You are receiving this because you are subscribed to

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-29 Thread Steve Kowalik
@s-t-e-v-e-n-k commented on this pull request. > +try: +from importlib.metadata import PathDistribution +except ImportError: +from importlib_metadata import PathDistribution + +try: +from pathlib import Path +except ImportError: +from pathlib2 import Path + + +class

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-12 Thread Steve Kowalik
@s-t-e-v-e-n-k commented on this pull request. > @@ -142,9 +210,23 @@ def convert(name, operator, version_id): def normalize_name(name): It can't, and I wish it could be -- https://src.fedoraproject.org/rpms/python-rpm-generators/blob/master/f/pythonbundles.py#_41 -- You are receiving

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-12 Thread Steve Kowalik
@s-t-e-v-e-n-k commented on this pull request. > +@classmethod +def normalize_name(klass, name): +"""https://www.python.org/dev/peps/pep-0503/#normalized-names""; +return re.sub(r'[-_.]+', '-', name).lower() + +@classmethod +def legacy_normalize_name(klass,

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-10-01 Thread Steve Kowalik
@s-t-e-v-e-n-k pushed 1 commit. 29f742a6b45b0d33463b963347cd083a1ebb2a71 pythondistdeps: Switch to importlib.metadata -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-28 Thread Steve Kowalik
@s-t-e-v-e-n-k commented on this pull request. > from warnings import warn +try: +from importlib.metadata import PathDistribution +except ImportError: +from importlib_metadata import PathDistribution + +try: +from pathlib import Path +except ImportError: +from pathlib2 import

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-24 Thread Steve Kowalik
@s-t-e-v-e-n-k commented on this pull request. > from warnings import warn +try: +from importlib.metadata import PathDistribution +except ImportError: +from importlib_metadata import PathDistribution + +try: +from pathlib import Path +except ImportError: +from pathlib2 import

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-24 Thread Steve Kowalik
@s-t-e-v-e-n-k pushed 1 commit. 20ad7b9b4845386ddb54ce2a88465e00d992fd0c pythondistdeps: Switch to importlib.metadata -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-22 Thread Steve Kowalik
@s-t-e-v-e-n-k commented on this pull request. > -dep_normalized_name = dep.key +dep_normalized_name = dep.name.lower().replace('_', '-') if args.legacy: -name =

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-09-03 Thread Steve Kowalik
@torsava Hi, do you have a chance over the next few days to check this over again? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-08-27 Thread Steve Kowalik
Latest push now has every test successfully run the script, however that one test still fails because there's a difference in behaviour between the script in this repo and in python-rpm-generators. ``` -if '>' == operator: -# distutils does not behave this way, but this is -

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-08-26 Thread Steve Kowalik
Once I remove the comments, it doesn't parse because the path doesn't contain pythonX.Y, so it can't determine the python version, so we need to do something there anyway. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-08-25 Thread Steve Kowalik
Okay, this new push solves all but one of the test failures, which has the script failing to parse the requires.txt for pyreq2rpm.tests since it contains comments. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-08-07 Thread Steve Kowalik
Any updates on the test suite investigation? Is there anything I can do to help? -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-07-23 Thread Steve Kowalik
As a further note about the packaging dependency -- pkg_resources has been using it since I think at least version 32 (I'd have to go back and check), and you've not noticed because setuptools vendors it. -- You are receiving this because you are subscribed to this thread. Reply to this email

[Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

2020-07-23 Thread Steve Kowalik
Stop using the heavy-weight pkg_resources and switch to a subclass of importlib.metadata. This does add a dependency on packaging as well for requirement and version parsing. I have also removed the comments about the attempted rewrite, since I have addressed many of the concerns. You can view,

Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: Switch to argparse (#1181)

2020-04-16 Thread Steve Kowalik
Yes, flake8 warns on needing two blank lines, not one. https://www.flake8rules.com/rules/E302.html -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: Switch to argparse (#1181)

2020-04-16 Thread Steve Kowalik
Would you like me to revert that part of the change? They are fairly self-contained, so easy enough to pull out in a separate change. -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: Switch to argparse (#1181)

2020-04-16 Thread Steve Kowalik
@s-t-e-v-e-n-k pushed 1 commit. 0afbfbb67b8b5d8346271a7d8d2351ad4ed0f411 scripts/pythondistdeps: Switch to argparse -- You are receiving this because you are subscribed to this thread. View it on GitHub:

Re: [Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: Switch to argparse (#1181)

2020-04-16 Thread Steve Kowalik
@s-t-e-v-e-n-k commented on this pull request. > +parser.add_argument('-P', '--provides', action='store_true', help='Print > Provides') +parser.add_argument('-R', '--requires', action='store_true', help='Print Requires') +parser.add_argument('-r', '--recommends', action='store_true',

[Rpm-maint] [rpm-software-management/rpm] scripts/pythondistdeps: Switch to argparse (#1181)

2020-04-15 Thread Steve Kowalik
Stop using getopt, and switch to a modern solution for parsing arguments. Drive-by fixing some flake8 warnings, mainly whitespace. You can view, comment on, or merge this pull request online at: https://github.com/rpm-software-management/rpm/pull/1181 -- Commit Summary -- *