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_requirements does not handle allow-prereleases field #12328

Open
wilsonliam opened this issue Jul 13, 2021 · 3 comments
Open

poetry_requirements does not handle allow-prereleases field #12328

wilsonliam opened this issue Jul 13, 2021 · 3 comments
Assignees
Labels
backend: Python Python backend-related issues

Comments

@wilsonliam
Copy link
Contributor

wilsonliam commented Jul 13, 2021

allow-prereleases field ignored when parsing dictionary attributes:

def handle_dict_attr(proj_name: str, attributes: dict[str, str], fp: str) -> str:
def produce_match(sep: str, feat: Optional[str]) -> str:
return f"{sep}{feat}" if feat else ""
git_lookup = attributes.get("git")
if git_lookup is not None:
rev_lookup = produce_match("#", attributes.get("rev"))
branch_lookup = produce_match("@", attributes.get("branch"))
tag_lookup = produce_match("@", attributes.get("tag"))
return f"{proj_name} @ git+{git_lookup}{tag_lookup}{branch_lookup}{rev_lookup}"
version_lookup = attributes.get("version")
path_lookup = attributes.get("path")
if path_lookup is not None:
return f"{proj_name} @ file://{path_lookup}"
url_lookup = attributes.get("url")
if url_lookup is not None:
return f"{proj_name} @ {url_lookup}"
if version_lookup is not None:
markers_lookup = produce_match(";", attributes.get("markers"))

@wilsonliam
Copy link
Contributor Author

After trying some hacky workarounds with limited testing success, I feel like this is best left to be resolved once pip options are usable (cf. #12327); specifically the pip --pre flag.

Eric-Arellano pushed a commit that referenced this issue Jul 20, 2021
…extras`) (#12323)

Addresses #12318 and #12319-- in general, adding support for handling these flags when using a `poetry_requirement`.

#12327/#12328 currently blocked; likely unblocked post-lockfile redesign (#12314)

[ci skip-rust]
[ci skip-build-wheels]
wilsonliam added a commit to wilsonliam/pants that referenced this issue Jul 20, 2021
…extras`) (pantsbuild#12323)

Addresses pantsbuild#12318 and pantsbuild#12319-- in general, adding support for handling these flags when using a `poetry_requirement`.

pantsbuild#12327/pantsbuild#12328 currently blocked; likely unblocked post-lockfile redesign (pantsbuild#12314)

[ci skip-rust]
[ci skip-build-wheels]
@thejcannon
Copy link
Member

@Eric-Arellano Where should we stand on this, now that we have a "native" lockfile which is better than Poetry's?

@Eric-Arellano
Copy link
Contributor

Still useful probably - this is intended for the poetry_requirements target generator, which parses pyproject.toml and ignores poetry.lock

@cognifloyd cognifloyd added the backend: Python Python backend-related issues label Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend: Python Python backend-related issues
Projects
None yet
Development

No branches or pull requests

4 participants