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

Error out if the requirements is not in protected-files (if destination contains requirements) #38

Closed
jaraco opened this issue Nov 15, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@jaraco
Copy link
Contributor

jaraco commented Nov 15, 2021

In pypa/setuptools#2825, I started working on applying vendoring to setuptools. I stated with this definition:

[tool.vendoring]
destination = "setuptools/_vendor/"
requirements = "setuptools/_vendor/vendored.txt"
namespace = "setuptools._vendor"

I then ran vendoring sync, and it failed with:

setuptools main $ vendoring sync
Working in .
Load configuration... Done!
Clean existing libraries... Done!
Add vendored libraries...  
  Running pip install -t setuptools/_vendor -r setuptools/_vendor/vendored.txt --no-compile --no-deps
    ERROR: Could not open requirements file: [Errno 2] No such file or directory: 'setuptools/_vendor/vendored.txt'
  Command exited with non-zero exit code: 1

It seems that it's necessary to specify:

protected-files = ["__init__.py", "README.rst", "vendored.txt"]

Perhaps vendoring could be smart enough to not delete the file indicated by requirements rather than requiring it to be specified twice.

@jaraco
Copy link
Contributor Author

jaraco commented Nov 15, 2021

I'd also suggest that __init__.py should be protected by default, as it's unlikely (impossible?) that it will ever be part of a pip-installed package, but is likely needed by any _vendor package.

@pradyunsg
Copy link
Owner

I'll take a look tomorrow evening. :)

@pradyunsg pradyunsg added the enhancement New feature or request label Jan 14, 2022
@pradyunsg pradyunsg changed the title Vendoring deletes its own requirements file Error out if the requirements is not in protected-files (if destination contains requirements) Jan 14, 2022
@jaraco
Copy link
Contributor Author

jaraco commented Jan 14, 2022

I noticed you changed the bug title to only error rather than honor the original request to ignore these expected ignores by default. In my opinion, requiring each user of vendoring to supply the same "ignore" entries in their config is clumsy. In my opinion, I'd rather it "just work", rather than have it fail and then direct the user to investigate and/or copy/paste the fix from one repo to another.

That said, since #37 indicates that this project won't support the Setuptools requirements, it's not particularly important to me to address this issue.

@pradyunsg
Copy link
Owner

I'd still like to address this. :)

@pradyunsg pradyunsg reopened this Jan 15, 2022
@pradyunsg
Copy link
Owner

369308a resolves this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants