Karolina Surma and Karolina Surma
ebd1b81075
Move to rpmautospec macros for changelog and release
...
rpmautospec has been present in Fedora since F35 and it's currently
a recommended way of handling the changelog and release specfile
entries: https://fedoraproject.org/wiki/Changes/rpmautospec
2023-04-25 16:24:37 +02:00
Karolina Surma and Karolina Surma
238faa40d6
Exit script correctly on a non-existing package ( fixes #30 )
2023-04-25 16:24:37 +02:00
Karolina Surma and Karolina Surma
dce4344006
Convert Python license classifiers to SPDX expressions
...
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.
2023-04-25 10:17:47 +02:00
Karolina Surma
83a3568192
Bump version 0.6.0 -> 0.6.1
2022-08-01 14:14:57 +02:00
Karolina Surma
dd292eb93c
Include LICENSE-MIT-0 in the sdist and fix license metadata
2022-08-01 14:14:44 +02:00
Karolina Surma
d9705f8536
Bump version 0.5.0 -> 0.6.0
2022-08-01 13:20:42 +02:00
Karolina Surma
e580d544ae
Add instructions how to record cassettes when needed
2022-08-01 12:59:24 +02:00
Karolina Surma
1ace5ce889
Normalize PyPI projects' name
...
- 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
2022-08-01 12:59:24 +02:00
Karolina Surma
a28d3a218e
Update license in package metadata
2022-08-01 12:59:24 +02:00
Karolina Surma
7b6b657f77
Relicense template.spec and derived files as MIT-0 (No attribution)
...
Fedora Legal plans to classify CC0 as content-only license, the
recommended equivalent for code being MIT-0:
https://lists.fedoraproject.org/archives/list/legal@lists.fedoraproject.org/thread/RRYM3CLYJYW64VSQIXY6IF3TCDZGS6LM/
With the agreement of all contributors to the template.spec (#25 ), this file and
any files produced by pyp2spec are now licensed as MIT-0.
Fixes : #25
2022-07-26 16:06:10 +02:00
Karolina Surma
ea39b14723
Clearly state the project's maturity as alpha
2022-06-20 13:00:13 +02:00
Karolina Surma
d574544cfc
Bump version 0.3.3 -> 0.4.0
2022-05-23 14:14:08 +02:00
Karolina Surma
76667d0f53
There's no URL in source anymore
2022-03-30 15:18:41 +02:00
Karolina Surma
dda1c5873b
Improve working with RPM/PyPI versions
...
- If the RPM and PyPI version strings differ, they both need to be acquired to
generate a valid spec file: PyPI string is needed for autosetup in %prep and
%pypi_source macro.
- Improve generating %{pypi_source} macro to incorporate the different
version strings if they differ. It not, there's no need to include it.
2022-03-30 15:18:41 +02:00
Karolina Surma
57c5799587
archive_name is now obtained in a better fashion
...
Instead of error-prone splitting the strings on hyphens, strip the
archive filename from the suffixes and versions, which shall result in
getting the pure archive name.
Refactor obtaining archive filename to traverse the json data just once.
2022-03-30 15:18:41 +02:00
Karolina Surma
38638cc2a0
Update documentation to reflect latest changes
2022-02-11 15:47:36 +01:00
Karolina Surma
7d7af97946
Convert PEP 440 package version to RPM scheme ( Fixes #20 )
...
- 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
2022-02-11 15:47:36 +01:00
Karolina Surma
c78ed80705
It's possible to declare --archful package via CLI ( #10 )
2022-02-11 14:15:33 +01:00
Karolina Surma
818b04fba9
Remove CLI duplicate short option
2022-02-10 10:31:49 +01:00
Karolina Surma
bf54f2bd9d
Rename CI job to 'test' - it doesn't build anything
2022-02-09 10:51:38 +01:00
Karolina Surma
a441b9ab66
Set betamax recording to 'none' - only reply existing cassettes
2022-02-09 10:51:38 +01:00
Karolina Surma
8d473ab526
Refactor tests significantly ( #14 )
...
- Test two spec files as generated files (one default, one custom).
This means any change to a template will require just one or two changes
in the files.
- Test each custom field separately, before they're saved to file.
- Remove configs/spec files which only duplicate what was already
tested.
2022-02-09 10:51:38 +01:00
Karolina Surma
53900db265
Fix some pylint suggestions
2022-02-09 10:51:38 +01:00
Karolina Surma
df32fc8113
Quit the scripts with sys.exit(), not exit()
2022-02-09 10:51:38 +01:00
Karolina Surma
4ecfc8af80
Remove generating the runtime requirements from spec file
...
pyproject-rpm-macros 0.53 made `-r` the default option.
2022-02-09 10:51:38 +01:00
Karolina Surma
7c215b1f0f
Get those quotation marks right
2022-02-04 13:15:09 +01:00
Karolina Surma
4544400ee5
Fix: actually assert the expression in tests
2022-01-12 09:41:56 +01:00
Karolina Surma
8c2e7d3909
Bump version 0.3.2 -> 0.3.3
2022-01-12 09:19:16 +01:00
Karolina Surma
897dba3961
Update changelog
2022-01-12 09:17:36 +01:00
Karolina Surma
707cb079fb
Refactor obtaining License ( #19 )
...
- Sometimes the License keyword contains the full license text instead of
a keyword (indicated by multiline string value).
In this case it's impossible to reliably derive the keyword,
hence such value is discarded.
- Added verbose docstring with License quirks' explanation
2022-01-10 11:18:50 +01:00
Karolina Surma
f79496ca20
Discard multiline Summary, use generated string instead ( #19 )
2022-01-10 11:18:50 +01:00
Karolina Surma
51c9b2d165
Generate Summary if not provided ( Fixes : #18 )
...
Summary can be gotten from upstream metadata or provided via CLI.
If upstream metadata is empty and no argument was provided,
generate an empty summary string to fill in the spec file.
2022-01-10 11:18:50 +01:00
Karolina Surma
74ec6c0b49
Make it visible that description must be updated by the packager
2022-01-10 11:08:28 +01:00
Karolina Surma
ffdf3f8dd6
Fix: spec files should end with a newline
2022-01-10 10:53:57 +01:00
Karolina Surma
11cbe83cd1
Bump version 0.3.1 -> 0.3.2
2021-12-10 11:48:10 +01:00
Karolina Surma
67266a4679
Use package_url if no project_urls are listed ( Fixes : #17 )
2021-12-10 10:26:53 +01:00
Karolina Surma
e09cf1b5ae
Bump release 0.3.0 -> 0.3.1
2021-12-09 08:24:55 +01:00
Karolina Surma
653450748d
Fix %pypi_source macro when sdist is zipped
2021-12-09 08:23:33 +01:00
Karolina Surma
862dfe892d
Bump version 0.2.0 -> 0.3.0
2021-12-08 17:35:49 +01:00
Karolina Surma
1296900be1
Add MANIFEST.in so that tests make it to sdist
2021-12-08 17:34:37 +01:00
Karolina Surma
a45a3e0cf7
Add changelog entries
2021-12-08 17:04:46 +01:00
Karolina Surma
c28b7c7b18
Recognize and declare zip sdist in Source macro ( fixes : #12 )
2021-12-08 17:04:46 +01:00
Karolina Surma
bebafff5d8
Ignore 'OSI Approved' in License classifiers ( Fixes : #13 )
2021-12-08 17:04:46 +01:00
Karolina Surma
164f97c871
Wrap description line on 79 characters ( Fixes : #11 )
2021-12-08 17:04:46 +01:00
Karolina Surma
2515603a18
Update cassettes so tests don't send real requests
2021-12-08 17:04:46 +01:00
Karolina Surma
429632d8ff
Bump version -> 0.2.0
2021-11-29 16:27:16 +01:00
Karolina Surma
fd2872be49
Start Changelog.md + update for 0.2.0
2021-11-29 16:24:45 +01:00
Karolina Surma
2e57d67542
Add the possibility to test only top-level modules in %%check
2021-11-26 17:45:50 +01:00
Karolina Surma
35f40c0ec4
Minor README corrections
2021-11-26 17:45:43 +01:00
Karolina Surma
36dc3676fc
Handle the exception when package name doesn't exist on PyPI
...
Instead of juicy traceback, print out a user-friendly message and exit.
Closes : #7
2021-11-24 13:53:11 +01:00
Karolina Surma
403e33e116
Update README - package goes to PyPI
2021-11-19 13:47:47 +01:00
Karolina Surma
62c5ba83b5
Use dummy filler for changelog if not set
2021-11-19 13:28:33 +01:00
Karolina Surma
81557fcb5a
Use trove classifiers for getting license
2021-11-19 13:28:33 +01:00
Karolina Surma and Patrik Kopkan
85dbdc833b
Create Python distribution
...
- closes #3
- closes #6
Co-authored-by: Patrik Kopkan <kopkanpatrik@gmail.com >
2021-11-11 12:13:11 +01:00
Karolina Surma
648cda5cae
Use importlib.resources to locate template file
2021-11-11 12:13:11 +01:00
Karolina Surma
f6775c83da
Move source code to its separate folder
2021-11-11 12:13:11 +01:00
Karolina Surma
3eebab4937
Move ConfigFile to conf2spec
2021-11-10 13:41:10 +01:00
Karolina Surma
4e0017c350
Pass command-line options as kwargs dict
...
Increase readability of the functions by removing listing of many
arguments.
Instead, the command-line options are passed as a dictionary until
the particular items are needed.
2021-11-03 13:32:17 +01:00
Karolina Surma
c34451c560
Add tests for the default program run
...
Test a few packages from PyPI to the final specfile.
Store them in different location so that it's clear which one are
default.
2021-11-03 13:32:17 +01:00
Karolina Surma
a332496b25
Distinguish tests with custom config modifications
...
The tests should cover both fully automated way of pyp2spec as well as
the custom modifications of conf2pyp (it can do more than we can
currently read from the upstream).
Mark custom tests clearly with conf2spec prefix.
2021-11-03 10:15:37 +01:00
Karolina Surma
4241adcb27
Support the new %pyproject_check_import macro
...
This allows to nuke the naive and error-prone generating of module names.
Support for %py3_check_import is dropped (its functionality is covered
by %pyproject_check_import).
2021-11-03 09:38:06 +01:00
Karolina Surma
2350790b81
Fix template path construction
2021-11-03 09:33:11 +01:00
Karolina Surma
857c8d71ff
Extend information on how to run scripts
2021-09-29 10:05:18 +02:00
Karolina Surma
7559688b9d
Add config file specification
2021-09-29 10:05:18 +02:00
Karolina Surma
a42e9352ef
Make command-line options nicer
2021-09-22 17:21:23 +02:00
Karolina Surma
004d2ce9f7
Update docstrings
2021-09-21 15:43:06 +02:00
Karolina Surma
bfae7d67b5
Log important events with click
2021-09-21 15:43:06 +02:00
Karolina Surma
2903d14585
Add missing command-line argument
2021-09-21 15:43:06 +02:00
Karolina Surma
35118ffda7
Handle logical evaluation of None correctly
2021-09-21 15:43:06 +02:00
Karolina Surma
849ee58e17
Fix handling command-line args
2021-09-21 15:43:06 +02:00
Karolina Surma
526bb5ced1
Ask to check the generated license with the Fedora Guidelines
2021-09-21 15:43:06 +02:00
Karolina Surma
083064e29c
Refactor is_url -> is_package-name
2021-09-21 15:43:06 +02:00
Karolina Surma
192b6ef1a2
Raise UsageError when License is missing
2021-09-20 09:02:05 +02:00
Karolina Surma
fa3de80ea8
Use archive name as %pypi_source argument
2021-09-15 09:15:55 +02:00
Karolina Surma
da9ddefe57
Update README
2021-09-14 17:08:39 +02:00
Karolina Surma
ad0d63578e
Unify formatting with black
2021-09-14 16:55:32 +02:00
Karolina Surma
ede0b143ba
Create user facing pyp2spec generating both parts together
2021-09-14 16:55:32 +02:00
Karolina Surma
61b7c6a999
Make create_config_contents more readable
2021-09-14 16:55:32 +02:00
Karolina Surma
b7dc8a2f76
Refactor: PyPI data are stored in a class now
2021-09-14 16:55:32 +02:00
Karolina Surma
c4710f8992
Ensure the created files are removed when tests fail
2021-09-14 16:55:32 +02:00
Karolina Surma
8e3d0e9645
Use betamax cassettes to record & replay requests to PyPI
2021-09-14 16:55:32 +02:00
Karolina Surma
6281df9766
Provide default description if not set through CLI
2021-09-14 08:55:08 +02:00
Karolina Surma
04d88798a6
Decide on package source based on package name - only PyPI now
2021-09-13 10:36:51 +02:00
Karolina Surma
069b0b980a
Get basic package info from PyPI
2021-09-13 09:30:24 +02:00
Karolina Surma
0dfa2440f7
Save empty config file
2021-09-13 08:42:53 +02:00
Karolina Surma
f53ef4ee7f
Provide modules as list, there may be more of them
2021-09-13 08:33:49 +02:00
Karolina Surma
5a67bce75e
Runtime BR's are implicitly required
2021-09-13 08:20:12 +02:00
Karolina Surma
dbca600ac1
Improve template formatting
2021-09-09 12:16:52 +02:00
Karolina Surma
a56993c468
Improve template - %doc nad %license are optional
2021-09-09 12:16:17 +02:00
Karolina Surma
2069fa03ad
Improve validation - don't try to be omnipotent
2021-09-09 11:22:22 +02:00
Karolina Surma
615df7d5df
Make it possible to set custom output for the spec file
2021-09-06 10:24:29 +02:00
Karolina Surma
293ae7427f
Implement config file validation
2021-09-02 13:12:34 +02:00
Karolina Surma
57ac75a838
Clean up after test execution
2021-09-02 13:10:36 +02:00
Karolina Surma
8f3ff493ac
Rename expected files so they match the generated ones
2021-09-02 13:09:48 +02:00
Karolina Surma
c42bf66529
Add python-aioflo config and specfile to tests
2021-09-01 19:13:29 +02:00
Karolina Surma
74d8f70bf6
Add python-boutdata test config and expected spec file
2021-09-01 17:44:02 +02:00
Karolina Surma
cf392c25a0
Improve formatting of BuildRequires
2021-09-01 17:32:39 +02:00
Karolina Surma
ec886bd215
Rename directory with expected spec files
...
This way it indicates explicitly the purpose of its contents.
2021-09-01 17:32:39 +02:00
Karolina Surma
0c8b2dbc1d
Refactor generating %check section
2021-09-01 17:32:39 +02:00
Karolina Surma
ad56d7193b
Refactor generating extra BR's to avoid space hell
2021-09-01 12:07:08 +02:00