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

WIP - support poetry with url #118

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/bzlmod/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ py_binary(
],
)

py_binary(
name = "cowsay_from_lock_file",
srcs = ["cowsay.py"],
main = "cowsay.py",
deps = [
"@poetry_lock_file//deps:cowsay",
],
)

pycross_poetry_lock_model(
name = "example_lock_model",
lock_file = "//:poetry.lock",
Expand Down
3 changes: 3 additions & 0 deletions examples/bzlmod/cowsay.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import cowsay

cowsay.cow("hello")
18 changes: 16 additions & 2 deletions examples/bzlmod/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

162 changes: 98 additions & 64 deletions examples/bzlmod/poetry_lock.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
# It is not intended for manual editing.
"""Pycross-generated dependency targets."""

load("@@rules_pycross~override//pycross:defs.bzl", "pycross_wheel_library", "pypi_file")
load("@@rules_pycross~override//pycross:defs.bzl", "pycross_wheel_build", "pycross_wheel_library", "pypi_file")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")

PINS = {
"cowsay": "[email protected]",
"ipython": "[email protected]",
"setuptools": "[email protected]",
"wheel": "[email protected]",
Expand Down Expand Up @@ -57,98 +59,98 @@ def targets():
)

native.alias(
name = "_env_python_3.11.6_aarch64-apple-darwin",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11.6_aarch64-apple-darwin_config",
name = "_env_python_3.11_aarch64-apple-darwin",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11_aarch64-apple-darwin_config",
)

native.alias(
name = "_env_python_3.11.6_aarch64-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11.6_aarch64-unknown-linux-gnu_config",
name = "_env_python_3.11_aarch64-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11_aarch64-unknown-linux-gnu_config",
)

native.alias(
name = "_env_python_3.11.6_ppc64le-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11.6_ppc64le-unknown-linux-gnu_config",
name = "_env_python_3.11_ppc64le-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11_ppc64le-unknown-linux-gnu_config",
)

native.alias(
name = "_env_python_3.11.6_s390x-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11.6_s390x-unknown-linux-gnu_config",
name = "_env_python_3.11_s390x-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11_s390x-unknown-linux-gnu_config",
)

native.alias(
name = "_env_python_3.11.6_x86_64-apple-darwin",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11.6_x86_64-apple-darwin_config",
name = "_env_python_3.11_x86_64-apple-darwin",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11_x86_64-apple-darwin_config",
)

native.alias(
name = "_env_python_3.11.6_x86_64-pc-windows-msvc",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11.6_x86_64-pc-windows-msvc_config",
name = "_env_python_3.11_x86_64-pc-windows-msvc",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11_x86_64-pc-windows-msvc_config",
)

native.alias(
name = "_env_python_3.11.6_x86_64-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11.6_x86_64-unknown-linux-gnu_config",
name = "_env_python_3.11_x86_64-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.11_x86_64-unknown-linux-gnu_config",
)

native.alias(
name = "_env_python_3.12.0_aarch64-apple-darwin",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12.0_aarch64-apple-darwin_config",
name = "_env_python_3.12_aarch64-apple-darwin",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12_aarch64-apple-darwin_config",
)

native.alias(
name = "_env_python_3.12.0_aarch64-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12.0_aarch64-unknown-linux-gnu_config",
name = "_env_python_3.12_aarch64-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12_aarch64-unknown-linux-gnu_config",
)

native.alias(
name = "_env_python_3.12.0_ppc64le-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12.0_ppc64le-unknown-linux-gnu_config",
name = "_env_python_3.12_ppc64le-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12_ppc64le-unknown-linux-gnu_config",
)

native.alias(
name = "_env_python_3.12.0_s390x-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12.0_s390x-unknown-linux-gnu_config",
name = "_env_python_3.12_s390x-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12_s390x-unknown-linux-gnu_config",
)

native.alias(
name = "_env_python_3.12.0_x86_64-apple-darwin",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12.0_x86_64-apple-darwin_config",
name = "_env_python_3.12_x86_64-apple-darwin",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12_x86_64-apple-darwin_config",
)

native.alias(
name = "_env_python_3.12.0_x86_64-pc-windows-msvc",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12.0_x86_64-pc-windows-msvc_config",
name = "_env_python_3.12_x86_64-pc-windows-msvc",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12_x86_64-pc-windows-msvc_config",
)

native.alias(
name = "_env_python_3.12.0_x86_64-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12.0_x86_64-unknown-linux-gnu_config",
name = "_env_python_3.12_x86_64-unknown-linux-gnu",
actual = "@@rules_pycross~override~environments~pycross_environments//:python_3.12_x86_64-unknown-linux-gnu_config",
)

# buildifier: disable=unused-variable
_target = select({
":_env_python_3.11.5_aarch64-apple-darwin": "@rules_pycross~override~environments~pycross_environments//:python_3.11.5_aarch64-apple-darwin.json",
":_env_python_3.11.5_aarch64-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.11.5_aarch64-unknown-linux-gnu.json",
":_env_python_3.11.5_ppc64le-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.11.5_ppc64le-unknown-linux-gnu.json",
":_env_python_3.11.5_s390x-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.11.5_s390x-unknown-linux-gnu.json",
":_env_python_3.11.5_x86_64-apple-darwin": "@rules_pycross~override~environments~pycross_environments//:python_3.11.5_x86_64-apple-darwin.json",
":_env_python_3.11.5_x86_64-pc-windows-msvc": "@rules_pycross~override~environments~pycross_environments//:python_3.11.5_x86_64-pc-windows-msvc.json",
":_env_python_3.11.5_x86_64-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.11.5_x86_64-unknown-linux-gnu.json",
":_env_python_3.11.6_aarch64-apple-darwin": "@rules_pycross~override~environments~pycross_environments//:python_3.11.6_aarch64-apple-darwin.json",
":_env_python_3.11.6_aarch64-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.11.6_aarch64-unknown-linux-gnu.json",
":_env_python_3.11.6_ppc64le-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.11.6_ppc64le-unknown-linux-gnu.json",
":_env_python_3.11.6_s390x-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.11.6_s390x-unknown-linux-gnu.json",
":_env_python_3.11.6_x86_64-apple-darwin": "@rules_pycross~override~environments~pycross_environments//:python_3.11.6_x86_64-apple-darwin.json",
":_env_python_3.11.6_x86_64-pc-windows-msvc": "@rules_pycross~override~environments~pycross_environments//:python_3.11.6_x86_64-pc-windows-msvc.json",
":_env_python_3.11.6_x86_64-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.11.6_x86_64-unknown-linux-gnu.json",
":_env_python_3.12.0_aarch64-apple-darwin": "@rules_pycross~override~environments~pycross_environments//:python_3.12.0_aarch64-apple-darwin.json",
":_env_python_3.12.0_aarch64-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.12.0_aarch64-unknown-linux-gnu.json",
":_env_python_3.12.0_ppc64le-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.12.0_ppc64le-unknown-linux-gnu.json",
":_env_python_3.12.0_s390x-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.12.0_s390x-unknown-linux-gnu.json",
":_env_python_3.12.0_x86_64-apple-darwin": "@rules_pycross~override~environments~pycross_environments//:python_3.12.0_x86_64-apple-darwin.json",
":_env_python_3.12.0_x86_64-pc-windows-msvc": "@rules_pycross~override~environments~pycross_environments//:python_3.12.0_x86_64-pc-windows-msvc.json",
":_env_python_3.12.0_x86_64-unknown-linux-gnu": "@rules_pycross~override~environments~pycross_environments//:python_3.12.0_x86_64-unknown-linux-gnu.json",
":_env_python_3.11.5_aarch64-apple-darwin": "@@rules_pycross~override~environments~pycross_environments//:python_3.11.5_aarch64-apple-darwin.json",
":_env_python_3.11.5_aarch64-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.11.5_aarch64-unknown-linux-gnu.json",
":_env_python_3.11.5_ppc64le-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.11.5_ppc64le-unknown-linux-gnu.json",
":_env_python_3.11.5_s390x-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.11.5_s390x-unknown-linux-gnu.json",
":_env_python_3.11.5_x86_64-apple-darwin": "@@rules_pycross~override~environments~pycross_environments//:python_3.11.5_x86_64-apple-darwin.json",
":_env_python_3.11.5_x86_64-pc-windows-msvc": "@@rules_pycross~override~environments~pycross_environments//:python_3.11.5_x86_64-pc-windows-msvc.json",
":_env_python_3.11.5_x86_64-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.11.5_x86_64-unknown-linux-gnu.json",
":_env_python_3.11_aarch64-apple-darwin": "@@rules_pycross~override~environments~pycross_environments//:python_3.11_aarch64-apple-darwin.json",
":_env_python_3.11_aarch64-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.11_aarch64-unknown-linux-gnu.json",
":_env_python_3.11_ppc64le-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.11_ppc64le-unknown-linux-gnu.json",
":_env_python_3.11_s390x-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.11_s390x-unknown-linux-gnu.json",
":_env_python_3.11_x86_64-apple-darwin": "@@rules_pycross~override~environments~pycross_environments//:python_3.11_x86_64-apple-darwin.json",
":_env_python_3.11_x86_64-pc-windows-msvc": "@@rules_pycross~override~environments~pycross_environments//:python_3.11_x86_64-pc-windows-msvc.json",
":_env_python_3.11_x86_64-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.11_x86_64-unknown-linux-gnu.json",
":_env_python_3.12_aarch64-apple-darwin": "@@rules_pycross~override~environments~pycross_environments//:python_3.12_aarch64-apple-darwin.json",
":_env_python_3.12_aarch64-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.12_aarch64-unknown-linux-gnu.json",
":_env_python_3.12_ppc64le-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.12_ppc64le-unknown-linux-gnu.json",
":_env_python_3.12_s390x-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.12_s390x-unknown-linux-gnu.json",
":_env_python_3.12_x86_64-apple-darwin": "@@rules_pycross~override~environments~pycross_environments//:python_3.12_x86_64-apple-darwin.json",
":_env_python_3.12_x86_64-pc-windows-msvc": "@@rules_pycross~override~environments~pycross_environments//:python_3.12_x86_64-pc-windows-msvc.json",
":_env_python_3.12_x86_64-unknown-linux-gnu": "@@rules_pycross~override~environments~pycross_environments//:python_3.12_x86_64-unknown-linux-gnu.json",
})

_asttokens_2_4_1_deps = [
Expand Down Expand Up @@ -176,6 +178,28 @@ def targets():
wheel = ":[email protected]",
)

native.alias(
name = "[email protected]",
actual = "@poetry_lock_sdist_v6.1//file",
)

pycross_wheel_build(
name = "[email protected]",
sdist = ":[email protected]",
target_environment = _target,
tags = ["manual"],
)

native.alias(
name = "[email protected]",
actual = ":[email protected]",
)

pycross_wheel_library(
name = "[email protected]",
wheel = ":[email protected]",
)

native.alias(
name = "[email protected]",
actual = "@poetry_lock_wheel_decorator_5.1.1_py3_none_any//file",
Expand Down Expand Up @@ -226,46 +250,46 @@ def targets():
":_env_python_3.11.5_x86_64-unknown-linux-gnu": [
":[email protected]",
],
":_env_python_3.11.6_aarch64-apple-darwin": [
":_env_python_3.11_aarch64-apple-darwin": [
":[email protected]",
],
":_env_python_3.11.6_aarch64-unknown-linux-gnu": [
":_env_python_3.11_aarch64-unknown-linux-gnu": [
":[email protected]",
],
":_env_python_3.11.6_ppc64le-unknown-linux-gnu": [
":_env_python_3.11_ppc64le-unknown-linux-gnu": [
":[email protected]",
],
":_env_python_3.11.6_s390x-unknown-linux-gnu": [
":_env_python_3.11_s390x-unknown-linux-gnu": [
":[email protected]",
],
":_env_python_3.11.6_x86_64-apple-darwin": [
":_env_python_3.11_x86_64-apple-darwin": [
":[email protected]",
],
":_env_python_3.11.6_x86_64-pc-windows-msvc": [
":_env_python_3.11_x86_64-pc-windows-msvc": [
":[email protected]",
],
":_env_python_3.11.6_x86_64-unknown-linux-gnu": [
":_env_python_3.11_x86_64-unknown-linux-gnu": [
":[email protected]",
],
":_env_python_3.12.0_aarch64-apple-darwin": [
":_env_python_3.12_aarch64-apple-darwin": [
":[email protected]",
],
":_env_python_3.12.0_aarch64-unknown-linux-gnu": [
":_env_python_3.12_aarch64-unknown-linux-gnu": [
":[email protected]",
],
":_env_python_3.12.0_ppc64le-unknown-linux-gnu": [
":_env_python_3.12_ppc64le-unknown-linux-gnu": [
":[email protected]",
],
":_env_python_3.12.0_s390x-unknown-linux-gnu": [
":_env_python_3.12_s390x-unknown-linux-gnu": [
":[email protected]",
],
":_env_python_3.12.0_x86_64-apple-darwin": [
":_env_python_3.12_x86_64-apple-darwin": [
":[email protected]",
],
":_env_python_3.12.0_x86_64-pc-windows-msvc": [
":_env_python_3.12_x86_64-pc-windows-msvc": [
":[email protected]",
],
":_env_python_3.12.0_x86_64-unknown-linux-gnu": [
":_env_python_3.12_x86_64-unknown-linux-gnu": [
":[email protected]",
],
"//conditions:default": [],
Expand Down Expand Up @@ -453,6 +477,16 @@ def targets():
def repositories():
"""Generated package repositories."""

maybe(
http_file,
name = "poetry_lock_sdist_v6.1",
urls = [
"https://github.com/VaasuDevanS/cowsay-python/archive/refs/tags/v6.1.zip",
],
sha256 = "f7937a2e721a308c0fd1c4b48c6c088ab4c221865a78057f456eba7bf67b547e",
downloaded_file_path = "v6.1.zip",
)

maybe(
pypi_file,
name = "poetry_lock_wheel_asttokens_2.4.1_py2.py3_none_any",
Expand Down
3 changes: 2 additions & 1 deletion examples/bzlmod/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ authors = []
python = ">=3.10"
ipython = ">=8.17"
setuptools = ">=68"
wheel = ">=0.42"
wheel = ">=0.42"
cowsay = {url = "https://github.com/VaasuDevanS/cowsay-python/archive/refs/tags/v6.1.zip"}
Loading
Loading