From 4d0fdb887d233eb0b6018ff25995fcdbe612b2a4506201ee8c4b1e55de39ad91 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 30 Jun 2024 19:09:27 +0000 Subject: [PATCH] - add py312-avoid-using-utcfromtimestamp.patch, py314-avoid-using-ast-str.patch - Update to v3.8.0 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flit-core?expand=0&rev=46 --- .gitattributes | 23 ++ .gitignore | 1 + _multibuild | 4 + flit_core-3.9.0.tar.gz | 3 + py312-avoid-using-utcfromtimestamp.patch | 33 +++ py314-avoid-using-ast-str.patch | 41 ++++ python-flit-core.changes | 260 +++++++++++++++++++++++ python-flit-core.spec | 125 +++++++++++ 8 files changed, 490 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 _multibuild create mode 100644 flit_core-3.9.0.tar.gz create mode 100644 py312-avoid-using-utcfromtimestamp.patch create mode 100644 py314-avoid-using-ast-str.patch create mode 100644 python-flit-core.changes create mode 100644 python-flit-core.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..9e55412 --- /dev/null +++ b/_multibuild @@ -0,0 +1,4 @@ + + primary + test + diff --git a/flit_core-3.9.0.tar.gz b/flit_core-3.9.0.tar.gz new file mode 100644 index 0000000..0740071 --- /dev/null +++ b/flit_core-3.9.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:72ad266176c4a3fcfab5f2930d76896059851240570ce9a98733b658cb786eba +size 41917 diff --git a/py312-avoid-using-utcfromtimestamp.patch b/py312-avoid-using-utcfromtimestamp.patch new file mode 100644 index 0000000..5012e9c --- /dev/null +++ b/py312-avoid-using-utcfromtimestamp.patch @@ -0,0 +1,33 @@ +From 915fa612e227fb4bf67f8484af5c8a399f108526 Mon Sep 17 00:00:00 2001 +From: Wim Jeantine-Glenn +Date: Mon, 13 May 2024 23:48:47 -0500 +Subject: [PATCH] datetime.utcfromtimestamp is deprecated in Python 3.12, avoid + using it + +https://docs.python.org/3/library/datetime.html#datetime.datetime.utcfromtimestamp +--- + flit_core/flit_core/wheel.py | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/flit_core/flit_core/wheel.py b/flit_core/flit_core/wheel.py +index b4a44b0d..dbf77372 100644 +--- a/flit_core/flit_core/wheel.py ++++ b/flit_core/flit_core/wheel.py +@@ -2,6 +2,7 @@ + from base64 import urlsafe_b64encode + import contextlib + from datetime import datetime ++from datetime import timezone + import hashlib + import io + import logging +@@ -42,7 +43,8 @@ def zip_timestamp_from_env() -> Optional[tuple]: + try: + # If SOURCE_DATE_EPOCH is set (e.g. by Debian), it's used for + # timestamps inside the zip file. +- d = datetime.utcfromtimestamp(int(os.environ['SOURCE_DATE_EPOCH'])) ++ t = int(os.environ['SOURCE_DATE_EPOCH']) ++ d = datetime.fromtimestamp(t, timezone.utc) + except (KeyError, ValueError): + # Otherwise, we'll use the mtime of files, and generated files will + # default to 2016-1-1 00:00:00 diff --git a/py314-avoid-using-ast-str.patch b/py314-avoid-using-ast-str.patch new file mode 100644 index 0000000..ae23dc5 --- /dev/null +++ b/py314-avoid-using-ast-str.patch @@ -0,0 +1,41 @@ +From 6ab62c91d0db451b5e9ab000f0dba5471550b442 Mon Sep 17 00:00:00 2001 +From: Thomas A Caswell +Date: Tue, 28 May 2024 10:25:13 -0400 +Subject: [PATCH] MNT: fix compatibility with Python 3.14 + +The ast.Str class was deprecated in 3.8 and will be removed in 3.14 +--- + flit_core/flit_core/common.py | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/flit_core/flit_core/common.py b/flit_core/flit_core/common.py +index 6625224b..8bcda3fb 100644 +--- a/flit_core/flit_core/common.py ++++ b/flit_core/flit_core/common.py +@@ -148,6 +148,10 @@ def get_docstring_and_version_via_ast(target): + with target_path.open('rb') as f: + node = ast.parse(f.read()) + for child in node.body: ++ if sys.version_info >= (3, 8): ++ target_type = ast.Constant ++ else: ++ target_type = ast.Str + # Only use the version from the given module if it's a simple + # string assignment to __version__ + is_version_str = ( +@@ -157,10 +161,13 @@ def get_docstring_and_version_via_ast(target): + and target.id == "__version__" + for target in child.targets + ) +- and isinstance(child.value, ast.Str) ++ and isinstance(child.value, target_type) + ) + if is_version_str: +- version = child.value.s ++ if sys.version_info >= (3, 8): ++ version = child.value.value ++ else: ++ version = child.value.s + break + return ast.get_docstring(node), version + diff --git a/python-flit-core.changes b/python-flit-core.changes new file mode 100644 index 0000000..a5e0400 --- /dev/null +++ b/python-flit-core.changes @@ -0,0 +1,260 @@ +------------------------------------------------------------------- +Sun Jun 30 19:09:04 UTC 2024 - Dirk Müller + +- add py312-avoid-using-utcfromtimestamp.patch, + py314-avoid-using-ast-str.patch + +------------------------------------------------------------------- +Fri Feb 23 12:20:15 UTC 2024 - Dominique Leuenberger + +- Use newly supported shrink{} on OBS to exclude python flavors + will all python versions skipped. + +------------------------------------------------------------------- +Thu Sep 7 10:50:43 UTC 2023 - Dirk Müller + +- update to 3.9.0: + * New options :option:`flit build --use-vcs` and :option:`flit + build --no-use-vcs` to enable & disable including all + committed files in the sdist. For now --use-vcs is the + default, but this is likely to change in a + future version, to bring flit build in line with standard + build frontends like python -m build + * Sdist file names, and the name of the top-level folder in an + sdist, are now normalised, in accordance with PEP 625 + * A statically defined version number can now be parsed from + files called version.py, _version.py or __version__.py inside + a packge, as well as from __init__.py, so executing code is + required in fewer cases + * Fix setting the flag for regular files in zip metadata + * The timestamp embedded in the gzip wrapper for sdists now + defaults to a fixed date, so building an sdist twice on the + same machine should produce identical results, even without + any special steps. + +------------------------------------------------------------------- +Fri Apr 21 12:25:17 UTC 2023 - Dirk Müller + +- add sle15_python_module_pythons (jsc#PED-68) + +------------------------------------------------------------------- +Thu Apr 13 22:41:20 UTC 2023 - Matej Cepl + +- Make calling of %{sle15modernpython} optional. + +------------------------------------------------------------------- +Sat Feb 11 21:00:12 UTC 2023 - Ben Greiner + +- Require python independent of python-rpm-packaging being there + to create the entry automatically + +------------------------------------------------------------------- +Fri Feb 10 14:01:13 UTC 2023 - Ben Greiner + +- Don't use :primary multibuild flavor for non-Tumbleweed + * accomodates special SLE15 projects defininig extra flavors but + not building for primary python3 + +------------------------------------------------------------------- +Fri Jan 27 15:43:53 UTC 2023 - Antonio Larrosa + +- Exclude the regular build in SLE15 SP5 as in SP4 instead of + leaving it as unresolvable + +------------------------------------------------------------------- +Tue Nov 8 00:36:32 UTC 2022 - Yogalakshmi Arunachalam + +- Update to v3.8.0 + + * Merge pull request #607 from pypa/relnotes-3.8 + Add release notes for version 3.8 + * Add --only-deps option to release notes + * Merge pull request #546 from dciborow/dciborow/install-reqs + Add "install-reqs" command to CLI + * Fix some remaining uses of tomli in the tests, for Python 3.11 + * Remove test with side effects + * Replace install-reqs subcommand with --only-deps option + * Merge pull request #581 from nanonyme/nanonyme/bytecode + * Merge pull request #602 from Mariatta/patch-1 + Document that token-based upload is supported + * Merge pull request #604 from gotmax23/tomli + Remove vestigial tomli usage + * Test on Python 3.11-dev + * Add python 3.11 to the test matrix + * Adjust test deps in tox.ini + * tests: Only use tomli if tomllib is missing + * Fallback to installed tomli when vendor is removed + In Fedora, we bootstrap tomli differently, so we remove the vendored + version. This makes it so we don't also have to patch flit_core.config + ourselves. + +------------------------------------------------------------------- +Fri Oct 7 12:16:47 UTC 2022 - Ben Greiner + +- Make sure the 15.4 tests also have python3-packaging +- Revert python_exec change, one pure wheel built by python3 is + enough + +------------------------------------------------------------------- +Fri Sep 30 11:52:39 UTC 2022 - Dirk Müller + +- use the python_exec to bootstrap so that the primary interpeter + is used + +------------------------------------------------------------------- +Tue Aug 2 19:03:15 UTC 2022 - Ben Greiner + +- Use prjconf provided primary_python if available + +------------------------------------------------------------------- +Thu Jul 14 22:27:53 UTC 2022 - Ben Greiner + +- Split primary flavor in multibuild for possible inclusion into + Ring0 + +------------------------------------------------------------------- +Thu Jul 14 15:34:09 UTC 2022 - Ben Greiner + +- Remove devendoring of tomli, so that we can put this in Ring0 + +------------------------------------------------------------------- +Fri Mar 25 12:10:11 UTC 2022 - Ben Greiner + +- Update to version 3.7.1 + * Support for external data files such as man pages or Jupyter + extension support files (PR #510). + * Project names are now lowercase in wheel filenames and + .dist-info folder names, in line with the specifications (PR + #498). + * Improved support for bootstrapping a Python environment, e.g. + for downstream packagers (PR #511). flit_core.wheel is usable + with python -m to create wheels before the build tool is + available, and flit_core sdists also include a script to + install itself from a wheel before installer is available. + * Use newer importlib APIs, fixing some deprecation warnings (PR + #499). + * Fix building packages which need execution to get the version + number, and have a relative import in __init__.py (PR #531). +- Update bootstrapping process + +------------------------------------------------------------------- +Sun Jan 9 14:53:21 UTC 2022 - Ben Greiner + +- Back to bootstrap without pip + +------------------------------------------------------------------- +Sun Jan 9 11:38:59 UTC 2022 - Ben Greiner + +- Update to version 3.6 + * flit_core now bundles the tomli TOML parser library (version + 1.2.3) to avoid a circular dependency between flit_core and + tomli (:ghpull:`492`). This means flit_core now has no + dependencies except Python itself, both at build time and at + runtime, simplifying :doc:`bootstrapping `. +- The above is not fully applicale to openSUSE, we debundle. +- Release notes for Version 3.5.1 + * Fix development installs with flit install --symlink and + --pth-file, which were broken in 3.5.0, especially for packages + using a src folder (:ghpull:`472`). +- Release notes for Version 3.5 + * You can now use Flit to distribute a module or package inside a + namespace package (as defined by PEP 420). To do this, specify + the import name of the concrete, inner module you are packaging + - e.g. name = "sphinxcontrib.foo" - either in the [project] + table, or under [tool.flit.module] if you want to use a + different name on PyPI (:ghpull:`468`). + * Flit no longer generates a setup.py file in sdists (.tar.gz + packages) by default (:ghpull:`462`). Modern packaging tools + don't need this. You can use the --setup-py flag to keep adding + it for now, but this will probably be removed at some point in + the future. + * Fixed how flit init handles authors' names with non-ASCII + characters (:ghpull:`460`). + * When flit init generates a LICENSE file, the new pyproject.toml + now references it (:ghpull:`467`). +- Do not package tests +- Make it work with old python-rpm-macros + +------------------------------------------------------------------- +Fri Oct 15 19:27:43 UTC 2021 - Ben Greiner + +- Break build cycle by using upstream recommended bootstrap method + https://flit.readthedocs.io/en/latest/bootstrap.html + +------------------------------------------------------------------- +Fri Oct 15 17:32:51 UTC 2021 - Ben Greiner + +- Update to Version 3.4 + * Python 3.6 or above is now required, both for flit and + flit_core. + * Add a --setup-py option to flit build and flit publish, + and a warning when neither this nor --no-setup-py are + specified (PR #431). A future version will stop + generating setup.py files in sdists by default. + * Add support for standardised editable installs - pip + install -e - according to PEP 660 (PR #400). + * Add a --pypirc option for flit publish to specify an + alternative path to a .pypirc config file describing + package indexes (PR #434). + * Fix installing dependencies specified in a [project] + table (PR #433) + * Fix building wheels when SOURCE_DATE_EPOCH (see + Reproducible builds) is set to a date before 1980 (PR + #448). + * Switch to using the tomli TOML parser, in common with + other packaging projects (PR #438). This supports TOML + version 1.0. + * Add a document on Bootstrapping (PR #441). +- Release Version 3.3 + * PKG-INFO files in sdists are now generated the same way + as METADATA in wheels, fixing some issues with sdists + (PR #410). + * flit publish now sends SHA-256 hashes, fixing uploads + to GitLab package repositories (PR #416). + * The [project] metadata table from PEP 621 is now fully + supported and documented. Projects using this can now + specify requires = ["flit_core >=3.2,<4"] in the + [build-system] table. +- Multibuild: break another depcycle with + pytest/importlib-metadata/tomli + +------------------------------------------------------------------- +Wed Apr 14 19:29:23 UTC 2021 - Matthias Bach + +- Update to version 3.2 + * Experimental support for specifying metadata in a [project] in + pyproject.toml table as specified by PEP-621. + * Fix writing METADATA file with multi-line information in + certain fields such as Author. + * Fix building wheel when a directory such as LICENSES appears + in the project root directory. + * Switch from the deprecated pytoml package to toml. + +------------------------------------------------------------------- +Mon Oct 26 22:38:40 UTC 2020 - Benjamin Greiner + +- Update to version 3.0 + * flit_core once again requires Python 3 (>=3.4). Packages that + support Python 2 can still be built by flit_core 2.x, but can't + rely on new features (:ghpull:`342`). +- Kill dephell dependency + +------------------------------------------------------------------- +Mon Mar 23 18:13:44 UTC 2020 - Matej Cepl + +- Add macro %dephell_genspec to generate setup.py + +------------------------------------------------------------------- +Sun Mar 15 10:01:34 UTC 2020 - Tomáš Chvátal + +- Fix generating with new dephell + +------------------------------------------------------------------- +Wed Dec 18 23:33:33 UTC 2019 - John Vandenberg + +- Remove dephell build workaround + +------------------------------------------------------------------- +Mon Dec 16 12:53:01 PM UTC 2019 - John Vandenberg + +- Initial spec for v2.1.0 diff --git a/python-flit-core.spec b/python-flit-core.spec new file mode 100644 index 0000000..24fb385 --- /dev/null +++ b/python-flit-core.spec @@ -0,0 +1,125 @@ +# +# spec file for package python-flit-core +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define modname flit-core +%global flavor @BUILD_FLAVOR@%{nil} +%define plainpython python +%if 0%{?suse_version} >= 1550 +# The primary python flavor is built in Factory Ring0 +%if "%{flavor}" == "primary" +%define pprefix %{primary_python} +%define pythons %{primary_python} +%endif +# Additional flavors are built in Factory Ring1 +%if "%{flavor}" == "" +%define pprefix python +%{expand:%%define skip_%{primary_python} 1} +%if "%{shrink:%{pythons}}" == "" +# Exclude for local osc build: unresolvable +%define python_module() empty-python-buildset +# Exclude for obs server +ExclusiveArch: do-not-build +%endif +%endif +%else +# backport and option d projects for 15.X having one or more python in the buildset don't need the Ring split for bootstrap +%if "%{flavor}" == "primary" +%define python_module() invalid-multibuild-flavor-for-15.X +ExclusiveArch: do-not-build +%else +%define pprefix python +%endif +%endif +# test everything in the buildset by standard python flavor expansion: primary and non-primary, if any. +%if "%{flavor}" == "test" +%define pprefix python +%define psuffix -test +%endif +%{?sle15_python_module_pythons} +Name: %{pprefix}-flit-core%{?psuffix} +Version: 3.9.0 +Release: 0 +Summary: Distribution-building parts of Flit +License: BSD-3-Clause AND MIT +URL: https://github.com/pypa/flit +Source0: https://files.pythonhosted.org/packages/source/f/flit_core/flit_core-%{version}.tar.gz +Patch1: https://github.com/pypa/flit/commit/915fa612e227fb4bf67f8484af5c8a399f108526.patch#/py312-avoid-using-utcfromtimestamp.patch +Patch2: https://github.com/pypa/flit/commit/6ab62c91d0db451b5e9ab000f0dba5471550b442.patch#/py314-avoid-using-ast-str.patch +BuildRequires: %{python_module base >= 3.6} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildArch: noarch +%if "%{flavor}" == "test" +BuildRequires: %{python_module flit-core = %{version}} +BuildRequires: %{python_module packaging} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module testpath} +%endif +# SECTION boo#1186870 +# We are a transitive build dependency of python-packaging +# which is used by pythondistdeps.py normally creating these entries +#!BuildIgnore: %{primary_python}-packaging +#!BuildIgnore: python3-packaging +Requires: %{plainpython}(abi) = %{python_version} +Provides: %{plainpython}%{python_version}dist(%{modname}) = %{version} +%if "%{python_flavor}" == "python3" || "%{python_provides}" == "python3" +Provides: %{plainpython}3-%{modname} = %{version}-%{release} +Provides: %{plainpython}3dist(%{modname}) = %{version} +Obsoletes: %{plainpython}3-%{modname} < %{version}-%{release} +%endif +# /SECTION +%python_subpackages + +%description +This provides a PEP 517 build backend for packages using Flit. +The only public interface is the API specified by PEP 517, at flit_core.buildapi. + +%prep +%autosetup -p2 -n flit_core-%{version} + +%if "%{flavor}" != "test" +%build +# https://flit.readthedocs.io/en/latest/bootstrap.html, take the first available python in the build set +mypython=%{expand:%%__%(echo %{pythons} | cut -d " " -f 1)} +$mypython -m flit_core.wheel + +%install +%{python_expand # +mkdir -p %{buildroot}%{$python_sitelib} +$python bootstrap_install.py dist/flit_core-%{version}-py3-none-any.whl -i %{buildroot}%{$python_sitelib} +# Don't package the tests +rm -r %{buildroot}%{$python_sitelib}/flit_core/tests +} +%{?python_compileall} +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif + +%if "%{flavor}" == "test" +%check +# make sure we do not test the sources but the package +rm flit_core/*.py pyproject.toml +%pytest -rfEs +%endif + +%if "%{flavor}" != "test" +%files %{python_files} +%{python_sitelib}/flit_core +%{python_sitelib}/flit_core-%{version}*-info +%endif + +%changelog