From af020e9ac9e77aa87a4e77453703139e8bb293ff Mon Sep 17 00:00:00 2001 From: Ondřej Nosek Date: Jun 26 2024 04:55:04 +0000 Subject: 1.45 Release Signed-off-by: Ondřej Nosek --- diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2ae2adc..84fb911 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -13,7 +13,7 @@ For bigger or controversial changes, consider first discussing it via [issue][issues] or any other method with the maintainers of this repository. Otherwise, there's a risk they might disagree with it and you could spend time on it in vain. Or you can just open a Pull Request and keep the discussion there. -All code should work well with Python 3 and also be compatible with Python 2.7. +All code should work well with Python 3. Code is [reviewed][code-review] by package maintainers. diff --git a/README.rst b/README.rst index cf00db5..7af6c69 100644 --- a/README.rst +++ b/README.rst @@ -3,7 +3,7 @@ Introduction This is the fedpkg project, which mostly is a subclass of the rpkg project. -fedpkg works with Python 3.6, 3.9, 3.10, 3.11, 3.12 +fedpkg works with Python 3.6, 3.9, 3.12 License ======= @@ -17,17 +17,12 @@ Install from distribution packages ---------------------------------- fedpkg is available in Fedora and EPEL repositories. It can be installed with -package manager command. There is Python 3 package for Fedora and EPEL8; -and Python 2 package in EPEL7. +package manager command. There is Python 3 package for Fedora and EPEL8 and EPEL9. Install in a Fedora system:: sudo dnf install fedpkg -Install in EPEL7:: - - sudo yum install fedpkg - Install in EPEL8:: sudo dnf install fedpkg diff --git a/doc/source/conf.py b/doc/source/conf.py index 5459eba..d06428d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -25,9 +25,9 @@ copyright = '{0}, fedpkg Team'.format(datetime.date.today().year) author = 'fedpkg Team' # The short X.Y version -version = '1.44' +version = '1.45' # The full version, including alpha/beta/rc tags -release = '1.44' +release = '1.45' # -- General configuration --------------------------------------------------- @@ -61,7 +61,7 @@ master_doc = 'index' # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. diff --git a/doc/source/releases.rst b/doc/source/releases.rst index 81696d5..adf7ebc 100644 --- a/doc/source/releases.rst +++ b/doc/source/releases.rst @@ -6,6 +6,7 @@ Releases .. toctree:: :maxdepth: 1 + releases/1.45 releases/1.44 releases/1.43 releases/1.42 diff --git a/doc/source/releases/1.45.rst b/doc/source/releases/1.45.rst new file mode 100644 index 0000000..2665780 --- /dev/null +++ b/doc/source/releases/1.45.rst @@ -0,0 +1,160 @@ +.. _release_1.45: + +fedpkg 1.45 Release Notes +========================= + +Released on *June 26, 2024* + +This release requires ``rpkg >= 1.67-1``. rpkg-1.67 `release notes`_ + +.. _`release notes`: https://docs.pagure.org/rpkg/releases/1.67.html + +Python compatibility +-------------------- + +fedpkg works with Python 3.6, 3.9, and 3.12 + +What's new in fedpkg 1.45 +------------------------- +Not everything is actually new. The next description covers changes since last 1.44 release. Since then some of features/fixes were already released as patches. + +Remove Python 2.7 support +~~~~~~~~~~~~~~~~~~~~~~~~~ +Currently, the only supported release that uses Python 2.7 is epel7 which is ending by the end of June (as per `#238`_). Therefore I removing the support for this old Python version. Code will stay as it is for now, only modifying scripts and configurations for testing and other Python 2 mentions. This also means that future code changes can break Python 2 compatibility. + +.. _`#238`: https://pagure.io/epel/issue/238 + +Remove pdc calls, use bodhi instead +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Since PDC is going to be `dismissed`_, all existing PDC queries should be removed and replaced with appropriate calls to the Bodhi API or distgit API. + +More information: `#535`_, `#537`_ + +.. _`#537`: https://pagure.io/fedpkg/pull-request/537 +.. _`#535`: https://pagure.io/fedpkg/issue/535 +.. _`dismissed`: https://fedora-arc.readthedocs.io/en/latest/pdc/index.html + +Allow package.cfg on rawhide/main branch +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Certain packages (such as fwupd and grub2) cannot be auto-rebuilt for Fedora ELN due to signing requirements. They have to be built manually by one of the short list of people that have the correct privilege. It's easy to forget to build for both releases, so it would be ideal if we could instead allow them to carry a package.cfg file on the Rawhide branch that would result in `fedpkg build` building for both Rawhide and ELN at the same time. + +This patch leaves in place the check for release branches (f40, f39, etc.) so that the presence of the package.cfg will not have an effect once Rawhide is branched. + +Methods for setting API tokens use getpass +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The methods `set-distgit-token`, `set-pagure-token` originally accepted a token as a command-line argument and this wasn't a sane approach. Now the token is safely put via getpass method. + +Also the code was moved to a shared place in rpkg because other tool uses it too. + +``disable-monitoring``: run manually only +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In the past, after the `retire` function, `disable-monitoring` was executed automatically. This functionality wasn't clear for users. Now only a manual run is possible. + +Also, more description was added to `disable-monitoring --help` page. It should prevent confusion when the operation fails (most likely because of a missing token or token with a lower ACL). + +Remove epel-playground support +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +EPEL Playground has been `shut down`_ in January 2022. Thus, carrying support for it only needlessly complicates the codebase. Remove all support and test cases for EPEL Playground. + +.. _`shut down`: https://docs.fedoraproject.org/en-US/epel/epel-about-playground/ + +``fedpkg update``: add option ``--severity`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +So far `--severity` was present only in a template and had to be uncommented in case of a security update. Now the update subcommand has this option with 'unspecified' as a default value. + +Allow fetching release from branch basename +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +In case fetching release information from the whole branch fails, retry with just part of branch name delimited by '-'. This should allow branches like rawhide-staging or f38-bz1234 to be recognized as a supported staging branches. + +Those are expected to be non-production, feature-only branches. +It should not allow to build these branches as a production build. + +Lookaside cache operations retries +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Both `upload` and `download` network operations might fail and in this case, a retry mechanism was implemented. + +In case of failure, there is a delay and another attempt(s). + +Delays are increasing with every attempt. A new key 'lookaside_attempts' in the configuration is there to parameterize such behavior. It expresses a maximum number of attempts to try the operation. Without this key, fedpkg will work the same as before = single attempt. + +Values 'lookaside_attempts = 1' or 'lookaside_attempts = 0' effectively disable retries too. + +The second new key 'lookaside_delay' is the initial delay (in seconds) between attempts that is doubled with each iteration. + +Improve invalid branch name error message +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Currently, if the resolved release name does not match any supported pattern ('rawhide', 'f38' or so), the following error is printed: +:: + + (foo) $ fedpkg prep + Could not execute prep: Could not find the release/dist from branch name foo + Please specify with --release + +This is fine when the current Git branch name was used when resolving the release. However, the exact same error is printed even if the '--release' option was used, like this: +:: + + $ fedpkg --release foo prep + Could not execute prep: Could not find the release/dist from branch name foo + Please specify with --release + +The error message is split into two cases depending on if --release was used (detected by checking if 'self.dist' is truthy): +:: + + (foo) $ fedpkg prep + Could not execute prep: Could not find release from branch name 'foo'. Please specify with --release. + $ fedpkg --release foo prep + Could not execute prep: Invalid release 'foo'. + +Update docker image for Jenkinks tests +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Regenerate the docker image: Fedora 33 --> Fedora 37. + +With the newer image, it appeared some files were missing in the 'MANIFEST.in'. + +Jenkinsfile as a pipeline script is unified with rpkg. + + +Other small fixes +~~~~~~~~~~~~~~~~~ +* Fix datetime.utcnow deprecation warning +* Fix tests on Python 3.12 by fixing pkg_resources dependency +* Update docker image for Jenkinks tests - Regenerate the docker image: Fedora 37 --> Fedora 39. +* Update the sendemail.to Fedora email addresses - `EmailAliases`_ +* check_branch: Fix backwards error message. When the user requests a branch that matches the branch regex, but is not active, the error message was backwards. +* Fix flake8 complaints +* fix: change changelog link +* Update link to the 'Share Test Code' documentation. +* Corrected the description of `--namespace`. +* Fix unittests after `--path` argument is validated +* Remove unused arches from completion + +.. _`EmailAliases`: https://fedoraproject.org/wiki/EmailAliases + +Change Logs +----------- +- Allow package.cfg on rawhide/main branch (sgallagh) +- Fix datetime.utcnow deprecation warning (dherrera) +- Remove Python 2.7 support (onosek) +- Fix tests on Python 3.12 by fixing pkg_resources dependency (dherrera) +- Remove traces of PDC in docstrings (lsegura) +- Remove function get_sl_type, no longer needed (lsegura) +- Remove pdc calls, use bodhi instead (lsegura) +- Update docker image for Jenkinks tests (onosek) +- Methods for setting API tokens use getpass - `rhbz#2089694`_ (onosek) +- Update the sendemail.to Fedora email addresses (miro) +- Remove epel-playground support (otto.liljalaakso) +- disable-monitoring: run manually only (onosek) +- `fedpkg update`: add option `--severity` (onosek) +- Allow fetching release from branch basename (pemensik) +- Lookaside cache operations retries (onosek) +- check_branch: Fix backwards error message (otaylor) +- Fix flake8 complaints (onosek) +- fix: change changelog link (amedvede) +- Update link to the `Share Test Code` documentation (psplicha) +- Corrected the description of --namespace. (Bjorn) +- Improve invalid branch name error message (otto.liljalaakso) +- Fix unittests after '--path' argument is validated (onosek) +- Remove unused arches from completion (mikel) +- Update docker image for Jenkinks tests (onosek) + +.. _`rhbz#2089694`: https://bugzilla.redhat.com/show_bug.cgi?id=2089694 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e758fc6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,90 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "fedpkg" +dynamic = ["license"] +version = "1.45" +description = "Fedora plugin to rpkg to manage package sources in a git repository" +readme = "README.rst" +authors = [ + { name = "Dennis Gilmore", email = "dgilmore@fedoraproject.org" }, +] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Intended Audience :: Developers", + "License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Build Tools", +] +dependencies = [ + "argcomplete", + "bodhi-client", + "distro", + "openidc-client", + "python-bugzilla", + "python-fedora", + "rpkg", + "six", +] + +[project.scripts] +fedpkg = "fedpkg.__main__:main" +fedpkg-stage = "fedpkg.__main__:main" + +[project.urls] +Homepage = "https://pagure.io/fedpkg" + +[tool.hatch.build.targets.sdist] +exclude = [ + "*.pyc", + "__pycache__", + "/doc/build", + "/doc/source/commands", + "/doc/source/_static", +] +only-exclude = [ + ".gitignore", + "/doc/source/cli.rst", + "/doc/source/man_pages.json", +] +include = [ + # dirs + "/conf", + "/doc", + "/fedpkg", + "/test", + # files + "CHANGELOG.rst", + "CONTRIBUTING.md", + "COPYING", + "git-changelog", + "Jenkinsfile", + "jenkins_test.dockerfile", + "Makefile", + "MANIFEST.in", + "pyproject.toml", + "README.rst", + "requirements.txt", + "setup.cfg", + "setup.py", + "tests-requirements.txt", + "tox.ini", +] + +[tool.hatch.build.targets.wheel] +packages = [ + "dist/fedpkg" +] + +[tool.hatch.build.targets.wheel.shared-data] +"conf/bash-completion" = "/usr/share/bash-completion/completions" +"conf/etc/rpkg/fedpkg-stage.conf" = "/etc/rpkg/fedpkg-stage.conf" +"conf/etc/rpkg/fedpkg.conf" = "/etc/rpkg/fedpkg.conf" +"conf/zsh-completion" = "/usr/share/zsh/site-functions" + diff --git a/setup.py b/setup.py index 136c30e..fbe34d7 100755 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ with open(tests_requirements, 'r') as f: setup( name="fedpkg", - version="1.44", + version="1.45", author="Dennis Gilmore", author_email="dgilmore@fedoraproject.org", description=("Fedora plugin to rpkg to manage " @@ -63,12 +63,9 @@ setup( 'Intended Audience :: Developers', 'Topic :: Software Development :: Build Tools', 'License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.9', - 'Programming Language :: Python :: 3.10', - 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], ) diff --git a/tests-requirements.txt b/tests-requirements.txt index a700317..178e74e 100644 --- a/tests-requirements.txt +++ b/tests-requirements.txt @@ -1,4 +1,4 @@ -mock >= 1.0.1;python_version<"3.3" +mock coverage<5.0.0 cccolutils gitpython diff --git a/tox.ini b/tox.ini index cafff3b..37fe636 100644 --- a/tox.ini +++ b/tox.ini @@ -1,13 +1,11 @@ [tox] -envlist = py36,py39,py310,py311,py312,flake8,doc,bandit +envlist = py36,py39,py312,flake8,doc,bandit [testenv] sitepackages=false basepython= py36: {env:TOXPYTHON:python3.6} py39: {env:TOXPYTHON:python3.9} - py310: {env:TOXPYTHON:python3.10} - py311: {env:TOXPYTHON:python3.11} py312: {env:TOXPYTHON:python3.12} flake8: {env:TOXPYTHON:python3.6} doc: {env:TOXPYTHON:python3}