Commit Graph

12 Commits

Author SHA1 Message Date
Tomas Orsava 0a5307e928 Testing proposed upstream changes
https://github.com/rpm-software-management/rpm/pull/1195

Added a new test suite
2020-04-29 17:53:29 +02:00
Gordon Messmer 0ec8581037 Handle all-zero versions without crashing
From https://github.com/rpm-software-management/rpm/pull/1184
2020-04-20 13:55:53 +02:00
Igor Raits 783dcc7147 Sync with upstream RPM dist generator 2020-04-10 12:31:30 +02:00
Miro Hrončok 7d819e0000 Also provide pythonXdist() with PEP 503 normalized names (#1791530)
That is, we add new provides that replace dots with a dash.

Package that used to provide python3dist(zope.component) and python3.8dist(zope.component)
now also provides python3dist(zope-component) and python3.8dist(zope-component).

Package that used to provide python3dist(a.-.-.-.a) now provides python3dist(a-a) as well.

This is consistent with pip behavior, `pip install zope-component` installs zope.component.

Historically, we have always used dist.key (safe_name) from setuptools,
but that is a non-standardized convention -- whether or not it replaces dots
with dashes is not even documented.
We say we use "canonical name" or "normalized name" everywhere, yet we didn't.

We really need to follow the standard (PEP 503):

https://www.python.org/dev/peps/pep-0503/#normalized-names

The proper function here would be packaging.utils.canonicalize_name
https://packaging.pypa.io/en/latest/utils/#packaging.utils.canonicalize_name
-- we reimplement it here to avoid an external dependency.

This is the first required step needed if we want to change our requirements later.
If we decide we don't, for whatever reason, this doesn't break anything.
2020-01-17 17:27:46 +01:00
Miro Hrončok 724a52a5f2 Fix more complicated requirement expressions by adding parenthesis
Puts bounded requirements into parenthesis

Fixes: https://github.com/rpm-software-management/rpm/issues/995
Upstream: https://github.com/rpm-software-management/rpm/pull/996

For this input: pyparsing>=2.0.1,!=2.0.4,!=2.1.2,!=2.1.6

Instead of (invalid):
(python3.8dist(pyparsing) >= 2.0.1 with
 python3.8dist(pyparsing) < 2.1.2 or python3.8dist(pyparsing) >= 2.1.2.0 with
 python3.8dist(pyparsing) < 2.1.6 or python3.8dist(pyparsing) >= 2.1.6.0 with
 python3.8dist(pyparsing) < 2.0.4 or python3.8dist(pyparsing) >= 2.0.4.0)

Produces (valid):
(python3.8dist(pyparsing) >= 2.0.1 with
 (python3.8dist(pyparsing) < 2.1.2 or python3.8dist(pyparsing) >= 2.1.2.0) with
 (python3.8dist(pyparsing) < 2.0.4 or python3.8dist(pyparsing) >= 2.0.4.0) with
 (python3.8dist(pyparsing) < 2.1.6 or python3.8dist(pyparsing) >= 2.1.6.0))

For this input: babel>=1.3,!=2.0

Instead of (invalid):
(python3.8dist(babel) >= 1.3 with
 python3.8dist(babel) < 2 or python3.8dist(babel) >= 2.0)

Produces (valid):
(python3.8dist(babel) >= 1.3 with
 (python3.8dist(babel) < 2 or python3.8dist(babel) >= 2.0))

For this input: pbr!=2.1.0,>=2.0.0

Instead of (invalid):
(python3.8dist(pbr) >= 2 with
 python3.8dist(pbr) < 2.1 or python3.8dist(pbr) >= 2.1.0)

Produces (valid):
(python3.8dist(pbr) >= 2 with
 (python3.8dist(pbr) < 2.1 or python3.8dist(pbr) >= 2.1.0))
2020-01-03 11:00:19 +01:00
Miro Hrončok ca811dbf35 Sync with upstream RPM
- Handle version ending with ".*"
 - Handle compatible-release operator "~="
 - Use rich deps for semantically versioned dependencies
 - Match Python version if minor has multiple digits (e.g. 3.10)
 - Only add setuptools requirement for egg-info packages

https://github.com/rpm-software-management/rpm/pull/951
https://github.com/rpm-software-management/rpm/pull/973
https://github.com/rpm-software-management/rpm/pull/982

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1758141
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1777382
2020-01-01 23:21:46 +01:00
Miro Hrončok ff085a044d Canonicalize Python versions and properly handle != spec
Fixes https://github.com/rpm-software-management/rpm/issues/639

From upstream PR:  https://github.com/rpm-software-management/rpm/pull/757
2019-06-24 14:44:19 +02:00
Miro Hrončok 70b3ebc993 console_scripts entry points to require setuptools
https://github.com/rpm-software-management/rpm/pull/666
2019-04-17 14:35:46 +02:00
Miro Hrončok 1879d8a0e2 Use nonstandardlib for purelib definition (#1609492)
The purelib and platlib were both defined to /usr/lib64/python on
64bits systems. This is because:

    >>> get_python_lib(standard_lib=1, plat_specific=0)
    '/usr/lib64/python3.7'

    >>> get_python_lib(standard_lib=1, plat_specific=1)
    '/usr/lib64/python3.7'

    >>> get_python_lib(standard_lib=0, plat_specific=0)
    '/usr/lib/python3.7/site-packages'

    >>> get_python_lib(standard_lib=0, plat_specific=1)
    '/usr/lib64/python3.7/site-packages'

So now we use standard_lib=0 to get the site-packages base path
from /usr/lib and not /usr/lib64.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1609492
2018-07-28 22:36:22 +02:00
Igor Gnatenko 5aa670bb39
"Fix" support of environment markers
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-11 00:50:57 +01:00
Igor Gnatenko b3ca5d8622
pythondistdeps.py: change shebang to python3
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-11 00:50:56 +01:00
Igor Gnatenko ad70cabb97
Fork upstream generators
This package is not being kept up to date, it's hard to maintain and we
will need to tune it from time to time which is painful.

Also removes whole layer of bootstrapping.

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
2018-02-11 00:50:54 +01:00