pyupio / dparse

A parser for Python dependency files
MIT License
61 stars 23 forks source link

Use ConfigParser directly #52

Closed pawamoy closed 2 years ago

pawamoy commented 3 years ago

Apparently SafeConfigParser was renamed to ConfigParser in Python 3.2, and the old SafeConfigParser name was kept for backward compatibility until Python 3.11.

Note: opening this to see how CI behaves. If it fails due to the changes in this PR, I'll try to import SafeConfigParser first then ConfigParser if it fails.

Fixes #51

codecov[bot] commented 3 years ago

Codecov Report

Merging #52 (796af29) into master (1d0fe72) will not change coverage. The diff coverage is 66.66%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #52   +/-   ##
=======================================
  Coverage   94.80%   94.80%           
=======================================
  Files          11       11           
  Lines         808      808           
=======================================
  Hits          766      766           
  Misses         42       42           
Impacted Files Coverage Δ
dparse/parser.py 87.68% <66.66%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1d0fe72...796af29. Read the comment docs.

pawamoy commented 3 years ago

I verified the statement above by looking at the code itself:

class SafeConfigParser(ConfigParser):
    """ConfigParser alias for backwards compatibility purposes."""

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        warnings.warn(
            "The SafeConfigParser class has been renamed to ConfigParser "
            "in Python 3.2. This alias will be removed in future versions."
            " Use ConfigParser directly instead.",
            DeprecationWarning, stacklevel=2
        )
pawamoy commented 3 years ago

Not sure why the codecov/patch job failed. Could you take a look @yeisonvargasf?

Also, I believe this change is safe since you seem to support Python versions down to 3.5 only.

pawamoy commented 2 years ago

A gentle ping :slightly_smiling_face: The change is safe to merge and release if you don't support Python versions before 3.2 :smile: