Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch from setuptools/pkg_resources to importlib.metadata #180

Closed
wants to merge 9 commits into from

Conversation

graingert
Copy link
Contributor

@graingert graingert commented Nov 11, 2020

Changes proposed in this pull request:

  • switch from setuptools/pkg_resources to importlib.metadata

@codecov-io
Copy link

codecov-io commented Nov 11, 2020

Codecov Report

Merging #180 (2159e38) into master (36bc853) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #180   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          569       572    +3     
=========================================
+ Hits           569       572    +3     
Flag Coverage Δ
GHA_Ubuntu 100.00% <100.00%> (ø)
GHA_Windows 100.00% <100.00%> (ø)
GHA_macOS 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/humanize/__init__.py 100.00% <100.00%> (ø)

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 36bc853...2159e38. Read the comment docs.

setup.cfg Outdated
@@ -56,7 +56,7 @@ max_line_length = 88
convention = google

[tool:isort]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please could you replace all these isort settings with profile = "black" and move it into pyproject.toml?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved all the configs I can into pyproject.toml

pyproject.toml Outdated
Comment on lines 38 to 41

[pytest]
addopts = --doctest-modules
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[pytest]
addopts = --doctest-modules

pyproject.toml Outdated
Comment on lines 14 to 16
[tool.pytest.ini_options]
addopts = "--color=yes"
Copy link
Contributor Author

@graingert graingert Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[tool.pytest.ini_options]
addopts = "--color=yes"
[tool.pytest.ini_options]
addopts = "--strict-config --strict-markers --color=yes --doctest-modules"
xfail_strict = true
junit_family = "xunit2"
filterwarnings = ["error"]

pyproject.toml Outdated
Comment on lines 15 to 16
[tool.pytest.ini_options]
addopts = "--color=yes --doctest-modules"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[tool.pytest.ini_options]
addopts = "--color=yes --doctest-modules"
[tool.pytest.ini_options]
addopts = "--strict-config --strict-markers --color=yes --doctest-modules"
xfail_strict = true
junit_family = "xunit2"
filterwarnings = ["error"]

Copy link
Contributor Author

@graingert graingert Nov 11, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hugovk do you want --color=yes enabled? it was in setup.cfg where it was ignored in favour of the config in tox.ini

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as we get coloured pytest output on GitHub Actions, it's fine to keep it in just one place.

Although please could we keep the tox.ini file? I'd prefer to keep that stuff in there because it's easier to look for and more common to have the test commands in there.

(pytest config can come here.)

Thanks!

pyproject.toml Outdated Show resolved Hide resolved
pyproject.toml Outdated Show resolved Hide resolved
graingert and others added 9 commits November 12, 2020 23:05
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
```
n = 7.0

    def _as_int(n):
        try:
            i = round(n)
        except TypeError:
            raise TypeError('Plural value must be an integer, got %s' %
                            (n.__class__.__name__,)) from None
        import warnings
>       warnings.warn('Plural value must be an integer, got %s' %
                      (n.__class__.__name__,),
                      DeprecationWarning, 4)
E       DeprecationWarning: Plural value must be an integer, got float

/usr/lib/python3.9/gettext.py:170: DeprecationWarning
```
black is already configured in pyproject.toml
Copy link
Collaborator

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Marking PR as "requested changes"

@graingert
Copy link
Contributor Author

@hugovk I think if you're going to have black/isort/pytest config in pyproject.toml you might as well put tox config in there too

@hugovk
Copy link
Collaborator

hugovk commented Oct 9, 2021

Done in #227. Thanks!

@hugovk hugovk closed this Oct 9, 2021
@graingert graingert deleted the importlib-metadata branch October 9, 2021 13:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants