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

Allow creating package zips from Git or HTTP locations through pip #122

Closed
sfc-gh-hachouraria opened this issue May 12, 2023 · 2 comments
Closed
Labels
enhancement New feature or request snowpark

Comments

@sfc-gh-hachouraria
Copy link

sfc-gh-hachouraria commented May 12, 2023

pip accepts a limited range of URL syntax for package names.

For example you could type the following to directly install packages from sources:

~> pip install 'git+https://github.com/user/repo.git@branch_name'

The snowcli package create [name] command accepts such URLs as arguments:

~> snow package create 'git+https://github.com/user/repo.git@branch_name'

However, it assumes that the name argument is also the filename for name.zip and will attempt to create a file named git+https://github.com/user/repo.git@branch_name.zip, which is invalid and will result in a final error:

~> snow package create 'git+https://github.com/user/repo.git@branch_name'
Collecting git+https://github.com/user/repo.git@branch_name
Cloning https://github.com/user/repo.git (to revision branch_name) to /private/var/folders/dj/8bdd294947dbq_y72_whrqj80000gn/T/pip-req-build-lug984pr
  Running command git clone --filter=blob:none --quiet https://github.com/user/repo.git /private/var/folders/dj/8bdd294947dbq_y72_whrqj80000gn/T/pip-req-build-lug984pr
Resolved https://github.com/user/repo.git to commit b76324ac90d93dc3bca382d90841a9ab5f398b50f
[… snipped …]
FileNotFoundError: [Errno 2] No such file or directory: 
'git+https://github.com/user/repo.git@branch_name.zip'

This prevents convenient packaging latest or fixed branches of popular repositories when they are required.

Could the name in case of URLs please be derived from the downloaded package metadata, or accepted as an optional add-on string?

@sfc-gh-hachouraria sfc-gh-hachouraria changed the title Allow creating package zips from Git or HTTP locations through Pip Allow creating package zips from Git or HTTP locations through pip May 12, 2023
@jeffhollan
Copy link

Good point. I like the idea of an optional flag to set package name. Something like snow package create 'git+...' -n my_package

@sfc-gh-turbaszek sfc-gh-turbaszek added snowpark enhancement New feature or request labels Feb 13, 2024
@sfc-gh-turbaszek sfc-gh-turbaszek linked a pull request Apr 2, 2024 that will close this issue
7 tasks
@sfc-gh-turbaszek sfc-gh-turbaszek removed a link to a pull request Apr 2, 2024
7 tasks
@sfc-gh-turbaszek
Copy link
Contributor

Done via #947

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

No branches or pull requests

3 participants