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

Poetry fails to install p4python due to read-only files #520

Closed
3 tasks done
epage opened this issue Oct 18, 2018 · 10 comments · Fixed by #1140
Closed
3 tasks done

Poetry fails to install p4python due to read-only files #520

epage opened this issue Oct 18, 2018 · 10 comments · Fixed by #1140
Assignees
Labels
area/installer Related to the dependency installer

Comments

@epage
Copy link
Contributor

epage commented Oct 18, 2018

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

Issue

In digging into the problem, it seems that p4python's files are all marked read-only, causing windows to error when trying to delete them via shutil.rmtree which is invoked by poetry's custom temp directory handling.

@nagulv
Copy link

nagulv commented Dec 7, 2018

I face the same issue.
Python 3.6.6 (v3.6.6:4cf1f54eb7, Jun 27 2018, 03:37:03) [MSC v.1900 64 bit (AMD64)] on win32

pip install p4python works:

pip install p4python
Collecting p4python
  Using cached https://files.pythonhosted.org/packages/e2/eb/9f948e36dc489299a918e8de305fa598a2759798a6e72ca3d5cbe2dbe862/p4python-2017.2.1615960-cp36-cp36m-win_amd64.whl
Installing collected packages: p4python
Successfully installed p4python-2017.2.1615960

Adding p4python via pipenv works as well.

I'm not sure why adding it via poetry retrieves p4python-2017.2.1615960.tar.gz and then throws the permissioning error:

[https://gist.github.com/nagulv/9be7c38d8796b1b1609d45041eaf5f30](p4python backtrace Gist)

@epage epage changed the title Poetry fails to install p4python Poetry fails to install p4python due to read-only files May 30, 2019
@epage
Copy link
Contributor Author

epage commented May 30, 2019

I decided to dig a little more into why this happens.

So it looks like poetry went to pypi to get the info.required_dists but p4python doesn't have that information in pypi's database

So poetry looks at all of the wheels. It will only look at the wheels if

  • there is a universal wheel
  • there is a platform wheel and no sdist

Because p4python is not universal and has an sdist, the sdist is favored.

So poetry downloads and tries to use the sdist. The problem is the sdist is probably built from source within perforce where all of the files are marked read-only unless someone is editing them. This then causes problems with the use of rmtree.

@epage
Copy link
Contributor Author

epage commented May 30, 2019

A quick workaround would be to have rmtree provide its own onerror

@epage
Copy link
Contributor Author

epage commented May 30, 2019

epage added a commit to epage/poetry that referenced this issue May 30, 2019
For a package without dependencies in pypi's database, like p4python,
the sdist is required.  The problem is p4python was developed in
perforce where all files are read-only by default and deleting the temp
directory fails.

So we need to use the custom-built temp directory and specially handle
read-only files to be able to use p4python in poetry.

Fixes python-poetry#520
epage added a commit to epage/poetry that referenced this issue May 30, 2019
For a package without dependencies in pypi's database, like p4python,
the sdist is required.  The problem is p4python was developed in
perforce where all files are read-only by default and deleting the temp
directory fails.

So we need to use the custom-built temp directory and specially handle
read-only files to be able to use p4python in poetry.

Fixes python-poetry#520
epage added a commit to epage/poetry that referenced this issue Jun 3, 2019
For a package without dependencies in pypi's database, like p4python,
the sdist is required.  The problem is p4python was developed in
perforce where all files are read-only by default and deleting the temp
directory fails.

So we need to use the custom-built temp directory and specially handle
read-only files to be able to use p4python in poetry.

Fixes python-poetry#520
@stale
Copy link

stale bot commented Nov 13, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 13, 2019
@epage
Copy link
Contributor Author

epage commented Nov 13, 2019

As a user, this is a bit frustrating for issues to be automatically closed when the problem is unresponsiveness from the maintainers.

@stale stale bot removed the stale label Nov 13, 2019
@finswimmer finswimmer added the area/installer Related to the dependency installer label Feb 7, 2020
@RoscoP
Copy link

RoscoP commented Feb 8, 2020

@epage Nice fix, I would like this fix as well. Looks like feedback from the PR wants this change to be against master and not develop.
#1140 (comment)

epage added a commit to epage/poetry that referenced this issue Feb 29, 2020
For a package without dependencies in pypi's database, like p4python,
the sdist is required.  The problem is p4python was developed in
perforce where all files are read-only by default and deleting the temp
directory fails.

So we need to use the custom-built temp directory and specially handle
read-only files to be able to use p4python in poetry.

Fixes python-poetry#520
epage added a commit to epage/poetry that referenced this issue Mar 13, 2020
For a package without dependencies in pypi's database, like p4python,
the sdist is required.  The problem is p4python was developed in
perforce where all files are read-only by default and deleting the temp
directory fails.

So we need to use the custom-built temp directory and specially handle
read-only files to be able to use p4python in poetry.

Fixes python-poetry#520
@bburgin
Copy link

bburgin commented Mar 25, 2020

Upvote, please merge in this fix.

epage added a commit to epage/poetry that referenced this issue Jun 2, 2020
For a package without dependencies in pypi's database, like p4python,
the sdist is required.  The problem is p4python was developed in
perforce where all files are read-only by default and deleting the temp
directory fails.

So we need to use the custom-built temp directory and specially handle
read-only files to be able to use p4python in poetry.

Fixes python-poetry#520
@thejcannon
Copy link
Contributor

This issue was re-introduced with the split to poetry-core: #3493

Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/installer Related to the dependency installer
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants