Skip to content

Commit

Permalink
Add [pyoxidizer].lockfile (#16537)
Browse files Browse the repository at this point in the history
I think that this was missing only due to oversight.

[ci skip-rust]
[ci skip-build-wheels]
  • Loading branch information
Eric-Arellano authored Aug 16, 2022
1 parent ffadd5f commit c9c1659
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 2 deletions.
2 changes: 2 additions & 0 deletions build-support/bin/_generate_all_lockfiles_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
from pants.backend.python.lint.pylint.subsystem import Pylint
from pants.backend.python.lint.pyupgrade.subsystem import PyUpgrade
from pants.backend.python.lint.yapf.subsystem import Yapf
from pants.backend.python.packaging.pyoxidizer.subsystem import PyOxidizer
from pants.backend.python.subsystems.debugpy import DebugPy
from pants.backend.python.subsystems.ipython import IPython
from pants.backend.python.subsystems.lambdex import Lambdex
Expand Down Expand Up @@ -116,6 +117,7 @@ def jvm(cls, tool: type[JvmToolBase], *, backend: str | None = None) -> DefaultT
DefaultTool.python(PyUpgrade, backend="pants.backend.experimental.python.lint.pyupgrade"),
DefaultTool.python(Pylint, backend="pants.backend.python.lint.pylint", source_plugins=True),
DefaultTool.python(PythonProtobufMypyPlugin, backend="pants.backend.codegen.protobuf.python"),
DefaultTool.python(PyOxidizer),
DefaultTool.python(Setuptools),
DefaultTool.python(SetuptoolsSCM),
DefaultTool.python(TerraformHcl2Parser, backend="pants.backend.experimental.terraform"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.backend.python.packaging.pyoxidizer import subsystem
from pants.backend.python.packaging.pyoxidizer.rules import rules as pyoxidizer_rules
from pants.backend.python.packaging.pyoxidizer.target_types import PyOxidizerTarget


def rules():
return [*pyoxidizer_rules()]
return [*pyoxidizer_rules(), *subsystem.rules()]


def target_types():
Expand Down
4 changes: 3 additions & 1 deletion src/python/pants/backend/python/packaging/pyoxidizer/BUILD
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

python_sources()
resource(name="lock", source="pyoxidizer.lock")

python_sources(overrides={"subsystem.py": {"dependencies": [":lock"]}})

python_tests(
name="tests",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
// This lockfile was autogenerated by Pants. To regenerate, run:
//
// build-support/bin/generate_all_lockfiles.sh
//
// --- BEGIN PANTS LOCKFILE METADATA: DO NOT EDIT OR REMOVE ---
// {
// "version": 3,
// "valid_for_interpreter_constraints": [
// "CPython<4,>=3.8"
// ],
// "generated_with_requirements": [
// "pyoxidizer==0.18.0"
// ],
// "indexes": [
// "https://pypi.org/simple/"
// ],
// "find_links": [],
// "manylinux": "manylinux2014",
// "requirement_constraints": [],
// "only_binary": [],
// "no_binary": []
// }
// --- END PANTS LOCKFILE METADATA ---

{
"allow_builds": true,
"allow_prereleases": false,
"allow_wheels": true,
"build_isolation": true,
"constraints": [],
"locked_resolves": [
{
"locked_requirements": [
{
"artifacts": [
{
"algorithm": "sha256",
"hash": "5ac421ea9d05488d745b0f340d64ed6cbcbea6c2adeca394662e9c582394579a",
"url": "https://files.pythonhosted.org/packages/8f/cd/2d865e341856220e8aecf6408808748e498727a7d6afae6522f838a15e37/pyoxidizer-0.18.0-py3-none-manylinux2014_armv7l.whl"
},
{
"algorithm": "sha256",
"hash": "488ccbb2bd78da47a76f4401486a9e29900ce67e601e24180744d548cd12dada",
"url": "https://files.pythonhosted.org/packages/3e/b9/40edb7a179953fdcfb8caf09b0fb6802b4c21ae2a9a2f5893bffb77b6c01/pyoxidizer-0.18.0-py3-none-manylinux2010_x86_64.whl"
},
{
"algorithm": "sha256",
"hash": "bb92388a02a11d023bee3d48f8b1343f59a7d2ab1b04489b9bd7df988ed9a1a0",
"url": "https://files.pythonhosted.org/packages/51/47/a2d608af0c94be395a1e4a8c10bc9a85263ada76a399b2516f4fcea64c08/pyoxidizer-0.18.0-py3-none-macosx_10_9_x86_64.whl"
},
{
"algorithm": "sha256",
"hash": "db936efed3cca44195c0d08706636220bbb1d426babd8fac7a85f6a99149b803",
"url": "https://files.pythonhosted.org/packages/52/00/cc4ab87ffdafdeed4fc2b832a786701924d25536e7c8b804dbc90667e2f9/pyoxidizer-0.18.0-py3-none-manylinux2014_aarch64.whl"
},
{
"algorithm": "sha256",
"hash": "3de42fa117fef3cf5f916de2380d2572838936e2215b8cb7eed072e15f04b836",
"url": "https://files.pythonhosted.org/packages/6b/1e/242e68bc472c0773f1c2ffb56e46f22d0fc1b18e8edf0c89be63890835f9/pyoxidizer-0.18.0-py3-none-macosx_11_0_arm64.whl"
},
{
"algorithm": "sha256",
"hash": "23debea5a5dab400edf583ddd3ff2e58b00c1c3ca45a9a37a97f9e300176faa3",
"url": "https://files.pythonhosted.org/packages/70/22/a291eb5651ec2d53f5e510635ff5f0cfbff5a1792d4953660e499f099f4f/pyoxidizer-0.18.0-py3-none-manylinux2010_i686.whl"
}
],
"project_name": "pyoxidizer",
"requires_dists": [],
"requires_python": null,
"version": "0.18"
}
],
"platform_tag": null
}
],
"path_mappings": {},
"pex_version": "2.1.103",
"prefer_older_binary": false,
"requirements": [
"pyoxidizer==0.18.0"
],
"requires_python": [
"<4,>=3.8"
],
"resolver_version": "pip-2020-resolver",
"style": "universal",
"target_systems": [
"linux",
"mac"
],
"transitive": true,
"use_pep517": null
}
34 changes: 34 additions & 0 deletions src/python/pants/backend/python/packaging/pyoxidizer/subsystem.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Copyright 2022 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from pants.backend.python.goals import lockfile
from pants.backend.python.goals.lockfile import GeneratePythonLockfile
from pants.backend.python.subsystems.python_tool_base import PythonToolBase
from pants.backend.python.subsystems.setup import PythonSetup
from pants.backend.python.target_types import ConsoleScript
from pants.backend.python.util_rules.pex_requirements import GeneratePythonToolLockfileSentinel
from pants.core.goals.generate_lockfiles import GenerateToolLockfileSentinel
from pants.engine.rules import collect_rules, rule
from pants.engine.unions import UnionRule
from pants.option.option_types import ArgsListOption
from pants.util.docutil import git_url
from pants.util.strutil import softwrap


Expand All @@ -25,4 +33,30 @@ class PyOxidizer(PythonToolBase):
register_interpreter_constraints = True
default_interpreter_constraints = ["CPython>=3.8,<4"]

register_lockfile = True
default_lockfile_resource = ("pants.backend.python.packaging.pyoxidizer", "pyoxidizer.lock")
default_lockfile_path = "src/python/pants/backend/python/packaging/pyoxidizer/pyoxidizer.lock"
default_lockfile_url = git_url(default_lockfile_path)

args = ArgsListOption(example="--release")


class PyoxidizerLockfileSentinel(GeneratePythonToolLockfileSentinel):
resolve_name = PyOxidizer.options_scope


@rule
def setup_lockfile_request(
_: PyoxidizerLockfileSentinel, pyoxidizer: PyOxidizer, python_setup: PythonSetup
) -> GeneratePythonLockfile:
return GeneratePythonLockfile.from_tool(
pyoxidizer, use_pex=python_setup.generate_lockfiles_with_pex
)


def rules():
return (
*collect_rules(),
*lockfile.rules(),
UnionRule(GenerateToolLockfileSentinel, PyoxidizerLockfileSentinel),
)

0 comments on commit c9c1659

Please sign in to comment.