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 new create_package_from_source takes care of creating the package object
and the "old" create_config_contents only modifies the bits needed for
the full config file.
This serves as a sort of contract, as opposed to a plain dictionary.
This enables control over all of the attributes and makes it reasonably
sure nothing gets unexpectedly mixed in.
The refactor contains changes:
- core metadata coming from the Metadata file are the canonical source
of truth to gather package info
- the archive metadata are still obtained from PyPI API, as core
metadata don't include any information about them
- OOP approach is refactored to the functional one to achieve clearer
design of multiple data sources and better testability of the
particular functions
- pyp2conf now contains only the logic of the actual data assembly, all
the helper methods are moved to the pypi_loaders, utils and
license_processor
(Effectively revert the removals done to implement PEP 625).
The removal was too haste and broke the users.
This reverts commit 9747b76c4f
and builds on top of the changes in between.
pyp2conf shouldn't be so heavy with RPM-specific data.
The data stored in the config file are the ones read from either the
PyPI API or Metadata file.
Everything related to transformations to specfiles is now stored in
conf2spec. It reads the config data and converts them to RPM-specific
format.
Ideally, if pyproject-rpm-macros become obsolete and a new system comes
in place, the only changes would be applicable on the side of conf2spec.
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
Always test the whole config contents even if the test is about a single
feature.
This ensures no regressions are accidentally introduced and ensures
wanted updates when recreating cassettes.