Skip to content

Use pathlib2 #636

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

Merged
merged 3 commits into from
Aug 20, 2018
Merged

Use pathlib2 #636

merged 3 commits into from
Aug 20, 2018

Conversation

adamchainz
Copy link
Member

@adamchainz adamchainz commented Aug 18, 2018

The dependency on pathlib was added in #631. A backport is needed for Python <3.4.

The pathlib package on PyPI is maintenance-only and comes with a message about using pathlib2 for an up-to-date version. Also pytest itself uses pathlib2 so currently I'm getting both packages installed when one would do.

This change in setup.py seems to be all that's needed to switch.

The dependency on `pathlib` was added in pytest-dev#631. A backport is needed for Python <3.4.

The `pathlib` package [on PyPI](https://pypi.org/project/pathlib/) is maintenance-only and comes with a message about using `pathlib2` for an up-to-date version, still importable as `pathlib`. Also `pytest` itself uses `pathlib2` so currently I'm getting both packages installed, one on top of the other, woops!

This change in `setup.py` seems to be all that's needed to switch.
@adamchainz adamchainz requested a review from blueyed August 18, 2018 12:51
Copy link
Contributor

@blueyed blueyed left a comment

Choose a reason for hiding this comment

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

Thanks, but from CI failures it looks like it needs something else for Python 2?

@adamchainz
Copy link
Member Author

Woops, turns out they don't have the same library name.

@codecov-io
Copy link

Codecov Report

Merging #636 into master will increase coverage by 6.91%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #636      +/-   ##
==========================================
+ Coverage   85.76%   92.68%   +6.91%     
==========================================
  Files          33       33              
  Lines        1799     1805       +6     
  Branches      154      154              
==========================================
+ Hits         1543     1673     +130     
+ Misses        204       94     -110     
+ Partials       52       38      -14
Flag Coverage Δ
#dj110 84.76% <50%> (?)
#dj111 87.2% <100%> (+6.04%) ⬆️
#dj18 85.76% <100%> (?)
#dj19 84.54% <50%> (?)
#dj20 85.04% <50%> (-0.18%) ⬇️
#dj21 80.99% <50%> (?)
#mysql_innodb 85.26% <100%> (?)
#mysql_myisam 85.09% <100%> (?)
#postgres 88.47% <100%> (+3.26%) ⬆️
#py27 90.19% <100%> (?)
#py34 84.54% <50%> (?)
#py35 84.76% <50%> (?)
#py36 85.59% <50%> (-0.18%) ⬇️
#py37 80.99% <50%> (?)
#sqlite 86.75% <50%> (+5.6%) ⬆️
#sqlite_file 84.54% <50%> (?)
Impacted Files Coverage Δ
pytest_django/plugin.py 86.47% <100%> (+4.09%) ⬆️
tests/conftest.py 100% <100%> (+5.66%) ⬆️
pytest_django/fixtures.py 97.22% <0%> (+1.11%) ⬆️
tests/test_fixtures.py 99.59% <0%> (+1.6%) ⬆️
tests/test_environment.py 100% <0%> (+2.17%) ⬆️
tests/test_db_setup.py 100% <0%> (+4.39%) ⬆️
tests/test_urls.py 100% <0%> (+8.33%) ⬆️
tests/test_database.py 99.16% <0%> (+11.66%) ⬆️
... and 8 more

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 5619f16...e9e0d57. Read the comment docs.

@blueyed blueyed dismissed their stale review August 20, 2018 13:14

Updated

@blueyed blueyed merged commit 43ff7bb into pytest-dev:master Aug 20, 2018
@graingert
Copy link
Member

looks like pytest are going to start exposing pathlib: https://twitter.com/ossronny/status/1043438562535006209?s=19

@blueyed
Copy link
Contributor

blueyed commented Sep 23, 2018

@graingert
Why is that relevant here?

@graingert
Copy link
Member

This code should change to from pytest import pathlib and will need the pathlib dep removed from setup.py

@blueyed
Copy link
Contributor

blueyed commented Sep 23, 2018

Ah, I see. Thanks.
No requirement though, but good to have - care to creatte a new issue to track this?

@adamchainz
Copy link
Member Author

Made #660

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.

4 participants