From 774a37dd2ce87fc1386515a01a8cb7fb274e9e66dc3a5f79a0df5a3bf8c4d958 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Tue, 12 Nov 2024 09:36:35 +0000 Subject: [PATCH] - Update to 0.6.4 * Fix "AttributeError: SafeConfigParser instance has no attribute 'values'" * Support poetry.lock version >= 1.5 * Add pyproject parser * Test pyproject parser * Add to readme * Remove python2-ism in the code * Migrate to pyproject.toml * Maybe you don't even need build-system * Add and fix workflows * Replace ConfigParser's 'readfp' by 'read_string' * Run tests on PR events * Trigger label check on fork PRs * ci(.github): revamp workflows and add hatch * perf(.github): prepare release workflows * perf(pyproject.toml): Set the start version of the new dparse release * ci(ci.yml): Set SLUG to release when the correct even is triggered * docs(CHANGELOG.md): Reset CHANGELOG.md * build(pyproject.toml): Fix steps for changelog generation * ci(release.yml): Download artifact from another workflow - Add python-hatchling to BuildRequires - Drop fix-configparser-parsing.patch, merged upstream OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-dparse?expand=0&rev=17 --- .gitattributes | 23 ++++++++ .gitignore | 1 + dparse-0.6.3.tar.gz | 3 + dparse-0.6.4.tar.gz | 3 + fix-configparser-parsing.patch | 42 +++++++++++++ python-dparse.changes | 105 +++++++++++++++++++++++++++++++++ python-dparse.spec | 73 +++++++++++++++++++++++ 7 files changed, 250 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 dparse-0.6.3.tar.gz create mode 100644 dparse-0.6.4.tar.gz create mode 100644 fix-configparser-parsing.patch create mode 100644 python-dparse.changes create mode 100644 python-dparse.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/dparse-0.6.3.tar.gz b/dparse-0.6.3.tar.gz new file mode 100644 index 0000000..e9dba25 --- /dev/null +++ b/dparse-0.6.3.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:27bb8b4bcaefec3997697ba3f6e06b2447200ba273c0b085c3d012a04571b528 +size 20316 diff --git a/dparse-0.6.4.tar.gz b/dparse-0.6.4.tar.gz new file mode 100644 index 0000000..ba27ab6 --- /dev/null +++ b/dparse-0.6.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:90b29c39e3edc36c6284c82c4132648eaf28a01863eb3c231c2512196132201a +size 27912 diff --git a/fix-configparser-parsing.patch b/fix-configparser-parsing.patch new file mode 100644 index 0000000..4090f86 --- /dev/null +++ b/fix-configparser-parsing.patch @@ -0,0 +1,42 @@ +From a3d83e8bdfd694e873b5775881ab5aa62fdbb674 Mon Sep 17 00:00:00 2001 +From: Mathieu Dupuy +Date: Fri, 8 Sep 2023 11:49:00 +0200 +Subject: [PATCH] replace ConfigParser's 'readfp' by 'read_string' + +fixes "DeprecationWarning: This method will be removed in Python 3.12. Use +parser.read_file instead", and will marginally improve performance +--- + dparse/parser.py | 6 ++---- + 1 file changed, 2 insertions(+), 4 deletions(-) + +diff --git a/dparse/parser.py b/dparse/parser.py +index f200607..923b362 100644 +--- a/dparse/parser.py ++++ b/dparse/parser.py +@@ -3,8 +3,6 @@ + import re + import sys + +-from io import StringIO +- + from configparser import ConfigParser, NoOptionError + from pathlib import PurePath + +@@ -305,7 +303,7 @@ def parse(self): + :return: + """ + parser = ConfigParser() +- parser.readfp(StringIO(self.obj.content)) ++ parser.read_string(self.obj.content) + for section in parser.sections(): + try: + content = parser.get(section=section, option="deps") +@@ -413,7 +411,7 @@ def parse(self): + class SetupCfgParser(Parser): + def parse(self): + parser = ConfigParser() +- parser.readfp(StringIO(self.obj.content)) ++ parser.read_string(self.obj.content) + for section in parser.values(): + if section.name == 'options': + options = 'install_requires', 'setup_requires', 'test_require' diff --git a/python-dparse.changes b/python-dparse.changes new file mode 100644 index 0000000..11f0c09 --- /dev/null +++ b/python-dparse.changes @@ -0,0 +1,105 @@ +------------------------------------------------------------------- +Tue Nov 12 08:40:35 UTC 2024 - John Paul Adrian Glaubitz + +- Update to 0.6.4 + * Fix "AttributeError: SafeConfigParser instance has no attribute 'values'" + * Support poetry.lock version >= 1.5 + * Add pyproject parser + * Test pyproject parser + * Add to readme + * Remove python2-ism in the code + * Migrate to pyproject.toml + * Maybe you don't even need build-system + * Add and fix workflows + * Replace ConfigParser's 'readfp' by 'read_string' + * Run tests on PR events + * Trigger label check on fork PRs + * ci(.github): revamp workflows and add hatch + * perf(.github): prepare release workflows + * perf(pyproject.toml): Set the start version of the new dparse release + * ci(ci.yml): Set SLUG to release when the correct even is triggered + * docs(CHANGELOG.md): Reset CHANGELOG.md + * build(pyproject.toml): Fix steps for changelog generation + * ci(release.yml): Download artifact from another workflow +- Add python-hatchling to BuildRequires +- Drop fix-configparser-parsing.patch, merged upstream + +------------------------------------------------------------------- +Mon Jan 15 05:33:37 UTC 2024 - Steve Kowalik + +- Switch to autosetup and pyproject macros. +- Stop using greedy globs in %files. +- Add patch fix-configparser-parsing.patch: + * Use non-deprecated/removed functions from ConfigParser. + +------------------------------------------------------------------- +Sat Jul 1 20:47:20 UTC 2023 - Dirk Müller + +- update to 0.6.3: + * Use the modern tomli/tomllib to parse TOML files. + * Drop Python 3.5 from our CI. + +------------------------------------------------------------------- +Thu Oct 27 22:55:51 UTC 2022 - Yogalakshmi Arunachalam + +- Update to 0.6.2 + * Fixed bug: always call the parent from the PATH in the resolve_file function. + +------------------------------------------------------------------- +Tue Sep 27 19:06:18 UTC 2022 - Yogalakshmi Arunachalam + +- update to 0.6.1 + * Use non-deprecated ConfiParser method + +- update to 0.6.0 + * Fork from upstream dparse that is unresponsive + * Rename package to dparse2 + * Fix security issue for GHSL-2021-111https://github.com/pyupio/dparse/issues/50 + * Drop support for Python < 3.6 and add support for up to 3.10 + * Drop support for updating requirements files + * format code with black, sort imports + +------------------------------------------------------------------- +Thu Sep 17 06:51:58 UTC 2020 - Dirk Mueller + +- update to 0.5.1: + * Fixed package metadata removing 2.7 support + * Install pipenv only when asked for with extras + +------------------------------------------------------------------- +Fri Apr 3 08:12:12 UTC 2020 - Marketa Calabkova + +- update to 0.5.0 + * Dropped Python 2.7, 3.3, 3.4 support + * Removed six package + * Removed pinned dependencies of tests + * Dropped setup.py tests support in favor of tox + +------------------------------------------------------------------- +Tue Apr 16 12:30:22 CEST 2019 - Matej Cepl + +- Although pipenv is required by upstream, tests pass even + without it, and we don't have it packaged yet. + +------------------------------------------------------------------- +Tue Feb 12 00:59:00 UTC 2019 - John Vandenberg + +- Update to v0.4.1 + * Fixed a packaging error +- for 0.4.0 + * pipenv is now an optional dependency that's only used when updating a Pipfile + * Added support for invalid toml Pipfiles +- for 0.3.0 + * Added support for setup.cfg files + * Dependencies from Pipfiles now include the section + * Multiline requirements are now ignored if they are marked + * Added experimental support for Pipfiles +- Remove unnecessary build dependency on python-devel and pytest-runner +- Added Recommends for pipenv, and disabled one test related to Pipfile + support. +- Use %license + +------------------------------------------------------------------- +Wed Jan 17 02:35:44 UTC 2018 - toddrme2178@gmail.com + +- Initial version for 0.2.1 diff --git a/python-dparse.spec b/python-dparse.spec new file mode 100644 index 0000000..1857b21 --- /dev/null +++ b/python-dparse.spec @@ -0,0 +1,73 @@ +# +# spec file for package python-dparse +# +# 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/ +# + + +%bcond_without test +Name: python-dparse +Version: 0.6.4 +Release: 0 +Summary: Python dependency file parser +License: MIT +URL: https://github.com/jayfk/dparse +Source: https://files.pythonhosted.org/packages/source/d/dparse/dparse-%{version}.tar.gz +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-PyYAML +Requires: python-packaging +Requires: (python-tomli if python-base < 3.11) +Recommends: python-pipenv +BuildArch: noarch +%if %{with test} +BuildRequires: %{python_module PyYAML} +BuildRequires: %{python_module packaging} +BuildRequires: %{python_module pytest} +%endif +%python_subpackages + +%description +A parser for Python dependency files. + +%prep +%autosetup -p1 -n dparse-%{version} +# Note vendor/toml.py could be unvendored + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%if %{with test} +%check +# There is a bug in the pipenv support, related to writing a new toml file. +# Both dparse and pipenv have a vendored copy of different toml libraries. +# and even more, we do not have pipenv in our distribution +%pytest --deselect 'tests/test_updater.py::test_update_pipfile' +%endif + +%files %{python_files} +%license LICENSE +%doc README.rst HISTORY.rst +%{python_sitelib}/dparse +%{python_sitelib}/dparse-%{version}.dist-info + +%changelog