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

Fix #2597 by checking that the directory exists #2602

Merged
merged 2 commits into from Jun 30, 2020

Conversation

PetterS
Copy link
Contributor

@PetterS PetterS commented Jun 29, 2020

Resolves: #2597

  • Added tests for changed code.

@PetterS
Copy link
Contributor Author

PetterS commented Jun 29, 2020

@abn

@PetterS
Copy link
Contributor Author

PetterS commented Jun 29, 2020

Will fix the Python 2.7 errors if this is reasonable.

Copy link
Member

@abn abn left a comment

We can potentially make use of the site.addpackage() method here. See suggestions.

poetry/repositories/installed_repository.py Outdated Show resolved Hide resolved
poetry/repositories/installed_repository.py Outdated Show resolved Hide resolved
@PetterS
Copy link
Contributor Author

PetterS commented Jun 30, 2020

Did the suggested changes. I don't understand the code well enough to write really good tests here, I'm afraid. The test currently mocks site.addpackage.

Copy link
Member

@abn abn left a comment

See comments, you should not need to change existing tests since the functionality should remain the same. Additionally, you will need to add couple of new fixtures in the istalled repository fixture such that the following cases are also evaluated;

  1. Multiple lines in .pth file.
  2. Executable in .pth file.

tests/repositories/test_installed_repository.py Outdated Show resolved Hide resolved
@PetterS
Copy link
Contributor Author

PetterS commented Jun 30, 2020

OK, I reverted the test file so you can see the error.

poetry/repositories/installed_repository.py Outdated Show resolved Hide resolved
poetry/repositories/installed_repository.py Show resolved Hide resolved
poetry/repositories/installed_repository.py Outdated Show resolved Hide resolved
@abn abn self-requested a review Jun 30, 2020
@abn
Copy link
Member

abn commented Jun 30, 2020

@PetterS I have applied a few changes. The changes themselves work; but need to rework for compatibility and add test case for executable .pth files.

poetry/repositories/installed_repository.py Outdated Show resolved Hide resolved
poetry/repositories/installed_repository.py Outdated Show resolved Hide resolved
@abn abn force-pushed the fix_2597 branch 2 times, most recently from 60b2a8a to 2978cbe Compare Jun 30, 2020
@abn abn self-requested a review Jun 30, 2020
abn
abn approved these changes Jun 30, 2020
@abn abn merged commit f6b0680 into python-poetry:develop Jun 30, 2020
@PetterS
Copy link
Contributor Author

PetterS commented Jul 1, 2020

Thanks for fixing this!

@abn abn linked an issue Jul 1, 2020 that may be closed by this pull request
@sdispater sdispater mentioned this pull request Jul 10, 2020
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.

Poetry 1.1.0a2 includes python code in the version string
2 participants