With `pyp2spec <pkgname> --path /pth/to/artifacts` a specfile will be
now generated from data available in sdist and wheel.
The `--path` option takes as a value a directory where the built artifacts
are stored.
When specified on command line, a compat package for a given version
will be created.
pyp2spec will create a specfile for the latest version matching the
compat one, e.g. for `pytest --compat 7` it will create specfile for
version 7.4.4; for `pytest --compat 7.2` - 7.2.2.
It is possible to specify both compat and specific version, e.g.:
`pytest --compat 7 --version 7.3.0`
The sdist filenames are now standardized:
- distribution name is normalized similarly to the project names, but
with "_" instead of "-"
- version string is expected to be PEP 440 compliant
- the supported file extension is tar.gz, zip is gone
Alongside with the license-related code the tests were significantly
refactored to run offline. The changes are intertwined and so shipped in
a single commit.
The licensing changes:
- updated Trove-Fedora mappings (removed Callaway expressions, added
SPDX)
- delegated the compliance check of Fedora licenses to a source
maintained by the Fedora Legal team
- the logic of license processing was moved to a dedicated module:
license_processor
The testing changes:
- moved betamax configuration to conftest.py to achieve a reliable global setting
- mocked fedora licensing data and PyPI package data to stop making
unnecessary requests - most of the betamax cassettes were deleted
- several tests rewritten, many added
- regenerated remaining betamax cassettes
This is a best-effort solution which can't (nor aims to) cover all edge-cases.
Unless Python adopts SPDX standard, this will always be an approximation.
- Replace underscores and dots with dashes in projects' names
Projects like sphinx_design result in python-sphinx-design.spec
and python3-sphinx-design built RPM name.
- Convert uppercase characters to lowercase
Projects like Pello result in python-pello.spec and python3-pello
built RPM name.
This conforms better with package naming guidelines:
https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_naming
- Include converter based on pyreq2rpm to create valid RPM versions
- For non-compatible versions no transformation is done, such string may
or may not work with RPM