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

Add support to install dependencies from code repository #555

Closed
bbgw opened this issue May 29, 2022 · 3 comments
Closed

Add support to install dependencies from code repository #555

bbgw opened this issue May 29, 2022 · 3 comments

Comments

@bbgw
Copy link

bbgw commented May 29, 2022

Phenomena

Migrating from requirements.txt

pandas
"git+https://github.com/a_project/a_repo.git"

to pyproject.toml and using Flit:

[build-system]
requires = ["flit_core >=3.2,<4"]
build-backend = "flit_core.buildapi"

[project]
name = "a_project"
dependencies = [
    "pandas",
    "git+https://github.com/a_project/a_repo.git"
]

With the above illustrated pyproject.toml, flit build results in error reading:

$ flit build
Could not parse requirement: 'git+https://github.com/a_project/a_repo.git'  E-flit.validate
Config error: Invalid config values (see log)

Expected Behavior

Expects dependency installation works, being consistent with pip install from a requirements.txt.

Reference

pip install dependencies from VCS

@bbgw
Copy link
Author

bbgw commented May 30, 2022

Figured it out and closing off the issue.

For anyone here, the problem is with the dependency format. (See StackOverflow):

a_repo_pkgname @ git+https://github.com/a_project/a_repo.git

@bbgw bbgw closed this as completed May 30, 2022
@palao
Copy link

palao commented Jun 8, 2022

Indeed it works for flit build. But it fails for flit publish:

requests.exceptions.HTTPError: 400 Client Error: Invalid value for requires_dist. Error: Can't have direct dependency: 'a_repo_pkgname @ git+https://github.com/a_project/a_repo.git' for url: https://upload.pypi.org/legacy/

Any idea?

@palao
Copy link

palao commented Jun 8, 2022

It seems to be the policy of PyPI to reject dependencies that are code repositories. Have a look at this.
Nothing to do with flit, as far as I can understand.

The only relevant thing is: flit displayed a python traceback when trying to publish.

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

No branches or pull requests

2 participants