pytest-dev / pytest-dev/pytest-html
Use importlib.resources rather than setuptools.pkg_resources
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 779
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
Could we change this package to use https://docs.python.org/3/library/importlib.html#importlib.resources.read_text? instead of pkg_resources from setuptools?
I see the following advantages
- pip installing setuptools doesn't play nice with tools like https://github.com/jazzband/pip-tools
- pkg_resources doesn't work with pyoxidizer https://pyoxidizer.readthedocs.io/en/stable/,
- importlib is part of the std library, meaning we have one less dependency (we can't always assume setuptools is going to be available, especially with things like pyinstaller, pyoxidize, etc)
The readme says we need python3.6 or newer, so we should be fine for compatibility, as importlib was added in 3.1.
I'll put up a PR shortly, its a pretty minimal change
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the package's use of setuptools.pkg_resources and review the Python 3.6 compatibility stated in the issue. Replace the resource-loading use with importlib.resources.read_text, remove the unnecessary setuptools dependency, and verify the existing test suite still passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100