15
0
forked from pool/python-dparse

- 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
This commit is contained in:
2024-11-12 09:36:35 +00:00
committed by Git OBS Bridge
commit 774a37dd2c
7 changed files with 250 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
From a3d83e8bdfd694e873b5775881ab5aa62fdbb674 Mon Sep 17 00:00:00 2001
From: Mathieu Dupuy <deronnax@gmail.com>
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'