From c439d618fe9813152b685d6f89f01e175b9be2f0 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 9 Aug 2023 10:30:21 +0200 Subject: [PATCH 01/10] Switch to PEP621 and hatchling Signed-off-by: Cristian Le --- MANIFEST.in | 1 - Makefile | 35 +++++++------------ bin/fmf | 40 ---------------------- fmf/__init__.py | 15 ++++---- pyproject.toml | 65 +++++++++++++++++++++++++++++++++++ setup.py | 80 ------------------------------------------- tests/unit/pytest.ini | 3 -- 7 files changed, 86 insertions(+), 153 deletions(-) delete mode 100644 MANIFEST.in delete mode 100755 bin/fmf create mode 100644 pyproject.toml delete mode 100755 setup.py delete mode 100644 tests/unit/pytest.ini diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index b4ac02bd..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1 +0,0 @@ -include fmf.spec diff --git a/Makefile b/Makefile index 9ee405b3..e80d7be8 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,10 @@ # Prepare variables TMP = $(CURDIR)/tmp -VERSION = $(shell grep ^Version fmf.spec | sed 's/.* //') -COMMIT = $(shell git rev-parse --short HEAD) -REPLACE_VERSION = "s/running from the source/$(VERSION) ($(COMMIT))/" +VERSION = $(hatch version) PACKAGE = fmf-$(VERSION) FILES = LICENSE README.rst \ - Makefile fmf.spec setup.py \ - examples fmf bin tests + Makefile fmf.spec pyproject.toml \ + examples fmf tests # Define special targets all: docs packages @@ -19,11 +17,11 @@ tmp: # Run the test suite, optionally with coverage test: tmp - pytest tests/unit -c tests/unit/pytest.ini + pytest tests/unit smoke: tmp - pytest tests/unit/test_smoke.py -c tests/unit/pytest.ini + pytest tests/unit/test_smoke.py coverage: tmp - coverage run --source=fmf,bin -m py.test -c tests/unit/pytest.ini tests + coverage run --source=fmf -m py.test tests coverage report coverage annotate @@ -31,23 +29,15 @@ coverage: tmp # Build documentation, prepare man page docs: man cd docs && make html -man: source +man: cp docs/header.txt $(TMP)/man.rst tail -n+7 README.rst >> $(TMP)/man.rst rst2man $(TMP)/man.rst > $(TMP)/$(PACKAGE)/fmf.1 # RPM packaging -source: clean tmp - mkdir -p $(TMP)/SOURCES - mkdir -p $(TMP)/$(PACKAGE) - cp -a $(FILES) $(TMP)/$(PACKAGE) - sed -i $(REPLACE_VERSION) $(TMP)/$(PACKAGE)/fmf/__init__.py -tarball: source man - cd $(TMP) && tar cfz SOURCES/$(PACKAGE).tar.gz $(PACKAGE) - @echo ./tmp/SOURCES/$(PACKAGE).tar.gz -version: - @echo "$(VERSION)" +tarball: man + python3 -m build --sdist rpm: tarball rpmbuild --define '_topdir $(TMP)' -bb fmf.spec srpm: tarball @@ -57,10 +47,9 @@ packages: rpm srpm # Python packaging wheel: - python setup.py bdist_wheel - python3 setup.py bdist_wheel -upload: - twine upload dist/*.whl + python3 -m build +upload: wheel tarball + twine upload dist/* # Vim tags and cleanup diff --git a/bin/fmf b/bin/fmf deleted file mode 100755 index 0b8a45df..00000000 --- a/bin/fmf +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/python -# coding: utf-8 - -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# fmf - Flexible Metadata Format -# Author: Petr Šplíchal -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2018 Red Hat, Inc. -# -# This program is free software: you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation, either version 2 of -# the License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied -# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see http://www.gnu.org/licenses/. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -import sys - -import fmf.base -import fmf.cli -import fmf.utils - -try: - fmf.cli.main() -except fmf.utils.GeneralError as error: - if "--debug" in sys.argv: - raise - fmf.utils.log.error(error) - raise SystemExit(1) diff --git a/fmf/__init__.py b/fmf/__init__.py index bdca5f5d..12af8b89 100644 --- a/fmf/__init__.py +++ b/fmf/__init__.py @@ -1,14 +1,17 @@ """ Flexible Metadata Format """ -# Version is replaced before building the package -__version__ = 'running from the source' +from __future__ import annotations + +import importlib.metadata + +from fmf.base import Tree +from fmf.context import Context +from fmf.utils import filter + +__version__ = importlib.metadata.version("fmf") __all__ = [ "Context", "Tree", "filter", ] - -from fmf.base import Tree -from fmf.context import Context -from fmf.utils import filter diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..0d692648 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,65 @@ +[build-system] +requires = ['hatchling'] +build-backend = 'hatchling.build' + +[project] +name = 'fmf' +authors = [ + { name = 'Petr Splichal', email = 'psplicha@redhat.com' }, +] +maintainers = [ + { name = 'Petr Splichal', email = 'psplicha@redhat.com' }, +] +description = 'Flexible Metadata Format' +readme = 'README.rst' +license = 'GPL-2.0-or-later' +license-files = { paths = ['LICENSE'] } +requires-python = '>=3.9' +classifiers = [ + 'Natural Language :: English', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Topic :: Utilities', +] +version = '1.4.0' +keywords = [ + 'metadata', + 'testing', +] +dependencies = [ + 'ruamel.yaml', + 'filelock', + 'jsonschema', +] + +[project.urls] +Homepage = 'https://github.com/teemtee/fmf' +Documentation = 'https://fmf.readthedocs.io' + +[project.optional-dependencies] +tests-cov = [ + 'fmf[tests]', + 'pytest-cov', +] +# Needed for tests inside rpm build. Not being pacakged in rpm +tests = [ + 'pytest', +] +# Needed for readthedocs and man page build. Not being packaged in rpm. +docs = [ + 'sphinx', + 'sphinx_rtd_theme', +] + +[project.scripts] +fmf = 'fmf.cli:main' + +[tool.pytest.ini_options] +markers = [ + "web: tests which need to access the web", +] +testpaths = [ + 'tests', +] diff --git a/setup.py b/setup.py deleted file mode 100755 index da308297..00000000 --- a/setup.py +++ /dev/null @@ -1,80 +0,0 @@ -#!/usr/bin/env python - -import re -from io import open - -from setuptools import setup - -# Parse version from the spec file -with open('fmf.spec', encoding='utf-8') as specfile: - lines = "\n".join(line.rstrip() for line in specfile) - version = re.search('Version: (.+)', lines).group(1).rstrip() - -# acceptable version schema: major.minor[.patch][sub] -__version__ = version -__pkg__ = 'fmf' -__pkgdir__ = {} -__pkgs__ = ['fmf'] -__provides__ = ['fmf'] -__desc__ = 'Flexible Metadata Format' -__scripts__ = ['bin/fmf'] - -# Prepare install requires and extra requires -install_requires = [ - 'ruamel.yaml', - 'filelock', - 'jsonschema', - ] -extras_require = { - 'docs': ['sphinx==7.2.4', 'sphinx-rtd-theme==1.3.0'], - 'tests': ['pytest', 'python-coveralls', 'pre-commit'], - } -extras_require['all'] = [ - dependency - for extra in extras_require.values() - for dependency in extra] - -pip_src = 'https://pypi.python.org/packages/source' -__deplinks__ = [] - -# README is in the parent directory -readme = 'README.rst' -with open(readme, encoding='utf-8') as _file: - readme = _file.read() - -github = 'https://github.com/psss/fmf' -download_url = '{0}/archive/master.zip'.format(github) - -default_setup = dict( - url=github, - license='GPLv2', - author='Petr Splichal', - author_email='psplicha@redhat.com', - maintainer='Petr Splichal', - maintainer_email='psplicha@redhat.com', - download_url=download_url, - long_description=readme, - data_files=[], - classifiers=[ - 'License :: OSI Approved :: GNU General Public License v2 (GPLv2)', - 'Natural Language :: English', - 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', - 'Topic :: Utilities', - ], - keywords=['metadata', 'testing'], - dependency_links=__deplinks__, - description=__desc__, - install_requires=install_requires, - extras_require=extras_require, - name=__pkg__, - package_dir=__pkgdir__, - packages=__pkgs__, - provides=__provides__, - scripts=__scripts__, - version=__version__, - ) - -setup(**default_setup) diff --git a/tests/unit/pytest.ini b/tests/unit/pytest.ini deleted file mode 100644 index cafe5e5d..00000000 --- a/tests/unit/pytest.ini +++ /dev/null @@ -1,3 +0,0 @@ -[pytest] -markers = - web: tests which need to access the web From ddf379e82fd58a66729dfa4a29fe7895f39e3013 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 9 Aug 2023 11:21:28 +0200 Subject: [PATCH 02/10] Improve spec file Signed-off-by: Cristian Le --- fmf.spec | 62 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/fmf.spec b/fmf.spec index ae8b0cb1..4b1c09e7 100644 --- a/fmf.spec +++ b/fmf.spec @@ -1,16 +1,19 @@ -Name: fmf -Version: 1.4.1 -Release: 1%{?dist} +Name: fmf +Version: 1.4.1 +Release: 1%{?dist} -Summary: Flexible Metadata Format -License: GPLv2+ -BuildArch: noarch +Summary: Flexible Metadata Format +License: GPL-2.0-or-later +BuildArch: noarch -URL: https://github.com/psss/fmf -Source0: https://github.com/psss/fmf/releases/download/%{version}/fmf-%{version}.tar.gz +URL: https://github.com/teemtee/fmf +Source: %{pypi_source fmf} # Main fmf package requires the Python module -Requires: python%{python3_pkgversion}-%{name} == %{version}-%{release} +BuildRequires: python3-devel +BuildRequires: python3dist(docutils) +BuildRequires: git-core +Requires: python3-fmf == %{version}-%{release} %description The fmf Python module and command line tool implement a flexible @@ -20,22 +23,12 @@ with support for inheritance and elasticity it provides an efficient way to organize data into well-sized text documents. This package contains the command line tool. -%?python_enable_dependency_generator - -%package -n python%{python3_pkgversion}-%{name} +%package -n python3-fmf Summary: %{summary} -BuildRequires: python%{python3_pkgversion}-devel -BuildRequires: python%{python3_pkgversion}-setuptools -BuildRequires: python%{python3_pkgversion}-pytest -BuildRequires: python%{python3_pkgversion}-ruamel-yaml -BuildRequires: python%{python3_pkgversion}-filelock -BuildRequires: python%{python3_pkgversion}-jsonschema -BuildRequires: git-core -%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}} Requires: git-core -%description -n python%{python3_pkgversion}-%{name} +%description -n python3-fmf The fmf Python module and command line tool implement a flexible format for defining metadata in plain text files which can be stored close to the source code. Thanks to hierarchical structure @@ -45,24 +38,31 @@ This package contains the Python 3 module. %prep -%autosetup +%autosetup -p1 -n fmf-%{version} + + +%generate_buildrequires +%pyproject_buildrequires -x tests %{?epel:-w} %build -%py3_build +%pyproject_wheel +cp docs/header.txt man.rst +tail -n+7 README.rst >> man.rst +rst2man man.rst > fmf.1 %install -%py3_install +%pyproject_install +%pyproject_save_files fmf + mkdir -p %{buildroot}%{_mandir}/man1 install -pm 644 fmf.1* %{buildroot}%{_mandir}/man1 %check -%{__python3} -m pytest -vv -c tests/unit/pytest.ini -m 'not web' - +%pytest -vv -m 'not web' -%{!?_licensedir:%global license %%doc} %files %{_mandir}/man1/* @@ -70,10 +70,12 @@ install -pm 644 fmf.1* %{buildroot}%{_mandir}/man1 %doc README.rst examples %license LICENSE -%files -n python%{python3_pkgversion}-%{name} -%{python3_sitelib}/%{name}/ -%{python3_sitelib}/%{name}-*.egg-info +%files -n python3-fmf -f %{pyproject_files} +# Epel9 does not tag the license file in pyproject_files as a license. Manually install it in this case +%if 0%{?el9} %license LICENSE +%endif +%doc README.rst %changelog From 5c3bec3040a78a6a541cc8002430268156d9935e Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Tue, 21 May 2024 10:27:12 +0200 Subject: [PATCH 03/10] Improve release workflow Signed-off-by: Cristian Le --- .github/workflows/release.yml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4ca4e41..3368da12 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: release +name: 🚀 Release on: release: @@ -11,18 +11,21 @@ on: jobs: release: + name: 🚀 Release runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/fmf + permissions: + id-token: write # For pypi-publish steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 if: ${{ github.event_name == 'release' }} - - uses: actions/checkout@v2 - if: ${{ github.event_name == 'workflow_dispatch' }} + - uses: actions/checkout@v4 with: ref: ${{ github.event.inputs.ref }} - - name: Create dist - run: make wheel + if: ${{ github.event_name == 'workflow_dispatch' }} + - name: Build package + run: pipx run build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} From d7f40ad791f4480a9be06c11731af24aaaa0e840 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 9 Aug 2023 16:44:42 +0200 Subject: [PATCH 04/10] Temporary fix for cli entry_point + test_suite Signed-off-by: Cristian Le --- fmf/cli.py | 9 +++++++++ pyproject.toml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/fmf/cli.py b/fmf/cli.py index 7fd1804d..f5dfbf60 100644 --- a/fmf/cli.py +++ b/fmf/cli.py @@ -209,3 +209,12 @@ def main(arguments=None, path=None): """ Parse options, do what is requested """ parser = Parser(arguments, path) return parser.output + + +def cli_entry(): + try: + main() + except fmf.utils.GeneralError as error: + if "--debug" not in sys.argv: + fmf.utils.log.error(error) + raise diff --git a/pyproject.toml b/pyproject.toml index 0d692648..f8f7965b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,7 +54,7 @@ docs = [ ] [project.scripts] -fmf = 'fmf.cli:main' +fmf = 'fmf.cli:cli_entry' [tool.pytest.ini_options] markers = [ From 914de467ce43ff85826b039178757ba0a6e7d19c Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Thu, 10 Aug 2023 10:07:43 +0200 Subject: [PATCH 05/10] Use hatch scripts Signed-off-by: Cristian Le --- .github/workflows/release.yml | 2 +- .packit.yaml | 11 +++++---- Makefile | 16 ++++++------- pyproject.toml | 45 +++++++++++++++++++++++++++++++---- 4 files changed, 56 insertions(+), 18 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3368da12..747edf2c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,6 @@ jobs: ref: ${{ github.event.inputs.ref }} if: ${{ github.event_name == 'workflow_dispatch' }} - name: Build package - run: pipx run build + run: pipx hatch build - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.packit.yaml b/.packit.yaml index cf35ac09..f59aedd8 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -5,15 +5,18 @@ synced_files: upstream_package_name: fmf downstream_package_name: fmf +# Epel9 fails to build with dynamic version. Need to create archive with PKG-INFO +# F37 works with setuptools_scm 7.0 actions: create-archive: - - make tarball + - "hatch build -t sdist" + - "sh -c 'echo dist/fmf-*.tar.gz'" get-current-version: - - make version + - "hatch version" srpm_build_deps: - - make - - python3-docutils + - hatch + - python3-hatch-vcs jobs: - job: copr_build diff --git a/Makefile b/Makefile index e80d7be8..1f0d6fc7 100644 --- a/Makefile +++ b/Makefile @@ -17,18 +17,16 @@ tmp: # Run the test suite, optionally with coverage test: tmp - pytest tests/unit + hatch run test:unit smoke: tmp - pytest tests/unit/test_smoke.py + hatch run test:smoke coverage: tmp - coverage run --source=fmf -m py.test tests - coverage report - coverage annotate + hatch run cov:cov # Build documentation, prepare man page docs: man - cd docs && make html + hatch run docs:html man: cp docs/header.txt $(TMP)/man.rst tail -n+7 README.rst >> $(TMP)/man.rst @@ -37,7 +35,7 @@ man: # RPM packaging tarball: man - python3 -m build --sdist + hatch build -t sdist rpm: tarball rpmbuild --define '_topdir $(TMP)' -bb fmf.spec srpm: tarball @@ -47,9 +45,9 @@ packages: rpm srpm # Python packaging wheel: - python3 -m build + hatch build -t wheel upload: wheel tarball - twine upload dist/* + hatch publish # Vim tags and cleanup diff --git a/pyproject.toml b/pyproject.toml index f8f7965b..9ba3621c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,10 +39,6 @@ Homepage = 'https://github.com/teemtee/fmf' Documentation = 'https://fmf.readthedocs.io' [project.optional-dependencies] -tests-cov = [ - 'fmf[tests]', - 'pytest-cov', -] # Needed for tests inside rpm build. Not being pacakged in rpm tests = [ 'pytest', @@ -56,6 +52,47 @@ docs = [ [project.scripts] fmf = 'fmf.cli:cli_entry' +[tool.hatch.envs.default] +platforms = ["linux"] + +[tool.hatch.envs.dev] +description = "Development environment" +dependencies = [ + "pytest-cov" +] +features = ["tests"] + +[tool.hatch.envs.dev.scripts] +type = ["mypy {args:tmt}"] +check = ["lint", "type"] + +unit = "pytest -vvv -ra --showlocals tests/unit" +smoke = "pytest -vvv -ra --showlocals tests/unit/test_cli.py" + +cov = [ + "coverage run --source=fmf -m pytest -vvv -ra --showlocals tests", + "coverage report", + "coverage annotate", + ] + +[tool.hatch.envs.dev-not-editable] +template = "dev" +description = "Same as 'dev', but not using editable install" +dev-mode = false + +[tool.hatch.envs.test] +template = "dev" +description = "Run scripts with multiple Python versions" + +[[tool.hatch.envs.test.matrix]] +python = ["3.9", "3.11", "3.12"] + +[tool.hatch.envs.docs] +features = ["docs"] + +[tool.hatch.envs.docs.scripts] +html = "sphinx-build -b html {root}/docs {root}/docs/_build {args}" + [tool.pytest.ini_options] markers = [ "web: tests which need to access the web", From 1e433dce67d4ad7bf8d9bfff341d17a2519a7100 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Wed, 9 Aug 2023 10:45:40 +0200 Subject: [PATCH 06/10] Switch to dynamic version Signed-off-by: Cristian Le --- .git_archival.txt | 3 +++ .gitattributes | 1 + fmf.spec | 2 +- pyproject.toml | 7 +++++-- 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 .git_archival.txt create mode 100644 .gitattributes diff --git a/.git_archival.txt b/.git_archival.txt new file mode 100644 index 00000000..7c510094 --- /dev/null +++ b/.git_archival.txt @@ -0,0 +1,3 @@ +node: $Format:%H$ +node-date: $Format:%cI$ +describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$ diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..00a7b00c --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.git_archival.txt export-subst diff --git a/fmf.spec b/fmf.spec index 4b1c09e7..f0b9c78f 100644 --- a/fmf.spec +++ b/fmf.spec @@ -1,5 +1,5 @@ Name: fmf -Version: 1.4.1 +Version: 0.0.0 Release: 1%{?dist} Summary: Flexible Metadata Format diff --git a/pyproject.toml b/pyproject.toml index 9ba3621c..5d7141bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ['hatchling'] +requires = ['hatchling', 'hatch-vcs'] build-backend = 'hatchling.build' [project] @@ -23,7 +23,6 @@ classifiers = [ 'Programming Language :: Python :: 3.12', 'Topic :: Utilities', ] -version = '1.4.0' keywords = [ 'metadata', 'testing', @@ -33,6 +32,7 @@ dependencies = [ 'filelock', 'jsonschema', ] +dynamic = ['version'] [project.urls] Homepage = 'https://github.com/teemtee/fmf' @@ -52,6 +52,9 @@ docs = [ [project.scripts] fmf = 'fmf.cli:cli_entry' +[tool.hatch] +version.source = 'vcs' + [tool.hatch.envs.default] platforms = ["linux"] From 991d44d3b2f05825b21f2bac675b0311794e4410 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Sun, 18 Aug 2024 22:06:55 +0200 Subject: [PATCH 07/10] Remove pytest from fmf.spec --- fmf.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fmf.spec b/fmf.spec index f0b9c78f..52772545 100644 --- a/fmf.spec +++ b/fmf.spec @@ -61,7 +61,7 @@ install -pm 644 fmf.1* %{buildroot}%{_mandir}/man1 %check -%pytest -vv -m 'not web' +%pyproject_check_import %files From 2ddc36f9ae85384d2883ac116e3e335f8662466c Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Sun, 18 Aug 2024 22:08:26 +0200 Subject: [PATCH 08/10] Remove workflow_dispatch from release workflow --- .github/workflows/release.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 747edf2c..1866b0f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,11 +3,6 @@ name: 🚀 Release on: release: types: [published] - workflow_dispatch: - inputs: - ref: - description: 'Tag to release' - required: true jobs: release: @@ -20,11 +15,6 @@ jobs: id-token: write # For pypi-publish steps: - uses: actions/checkout@v4 - if: ${{ github.event_name == 'release' }} - - uses: actions/checkout@v4 - with: - ref: ${{ github.event.inputs.ref }} - if: ${{ github.event_name == 'workflow_dispatch' }} - name: Build package run: pipx hatch build - name: Publish to PyPI From acd1415299ef9bd76476e107e32176a636fb1f60 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Sun, 18 Aug 2024 22:20:12 +0200 Subject: [PATCH 09/10] Merge `python-fmf` with `fmf` --- fmf.spec | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/fmf.spec b/fmf.spec index 52772545..d2391a83 100644 --- a/fmf.spec +++ b/fmf.spec @@ -13,28 +13,16 @@ Source: %{pypi_source fmf} BuildRequires: python3-devel BuildRequires: python3dist(docutils) BuildRequires: git-core -Requires: python3-fmf == %{version}-%{release} +Requires: git-core -%description -The fmf Python module and command line tool implement a flexible -format for defining metadata in plain text files which can be -stored close to the source code. Thanks to hierarchical structure -with support for inheritance and elasticity it provides an -efficient way to organize data into well-sized text documents. -This package contains the command line tool. +%py_provides python3-fmf - -%package -n python3-fmf -Summary: %{summary} -Requires: git-core - -%description -n python3-fmf +%description The fmf Python module and command line tool implement a flexible format for defining metadata in plain text files which can be stored close to the source code. Thanks to hierarchical structure with support for inheritance and elasticity it provides an efficient way to organize data into well-sized text documents. -This package contains the Python 3 module. %prep @@ -64,18 +52,14 @@ install -pm 644 fmf.1* %{buildroot}%{_mandir}/man1 %pyproject_check_import -%files +%files -f %{pyproject_files} %{_mandir}/man1/* %{_bindir}/%{name} %doc README.rst examples -%license LICENSE - -%files -n python3-fmf -f %{pyproject_files} # Epel9 does not tag the license file in pyproject_files as a license. Manually install it in this case %if 0%{?el9} %license LICENSE %endif -%doc README.rst %changelog From 078c07a37f626969f4f5a669dcef67bf8af32260 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Sun, 18 Aug 2024 22:12:24 +0200 Subject: [PATCH 10/10] Drop epel9 workaround for packit Signed-off-by: Cristian Le --- .packit.yaml | 13 ------------- fmf.spec | 6 ++++++ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index f59aedd8..c5c71937 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -5,19 +5,6 @@ synced_files: upstream_package_name: fmf downstream_package_name: fmf -# Epel9 fails to build with dynamic version. Need to create archive with PKG-INFO -# F37 works with setuptools_scm 7.0 -actions: - create-archive: - - "hatch build -t sdist" - - "sh -c 'echo dist/fmf-*.tar.gz'" - get-current-version: - - "hatch version" - -srpm_build_deps: - - hatch - - python3-hatch-vcs - jobs: - job: copr_build trigger: pull_request diff --git a/fmf.spec b/fmf.spec index d2391a83..a80cc5bf 100644 --- a/fmf.spec +++ b/fmf.spec @@ -30,10 +30,16 @@ efficient way to organize data into well-sized text documents. %generate_buildrequires +%if 0%{?el9} +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" +%endif %pyproject_buildrequires -x tests %{?epel:-w} %build +%if 0%{?el9} +export SETUPTOOLS_SCM_PRETEND_VERSION="%{version}" +%endif %pyproject_wheel cp docs/header.txt man.rst tail -n+7 README.rst >> man.rst