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

Py311 support #5

Merged
merged 4 commits into from
Aug 20, 2023
Merged
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
3 changes: 3 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Initialize Pants
uses: pantsbuild/actions/init-pants@main
with:
Expand Down
13 changes: 13 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,21 @@ repos:
hooks:
- id: no-commit-to-branch

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.0.285
hooks:
- id: ruff

- repo: local
hooks:
- id: build_files_check
name: build_files_check
entry: "pants tailor --check update-build-files --check ::"
language: system
files: BUILD$
types: [file]
pass_filenames: false
- id: lint
name: Lint
entry: pants --changed-since=HEAD --changed-dependents=transitive lint
Expand Down
1 change: 1 addition & 0 deletions _pants/py_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def py_package(
classifiers=[
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
extras_require=extras_require or {},
long_description_content_type="text/markdown",
Expand Down
1 change: 1 addition & 0 deletions _pants/py_test_versions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test_versions = parametrize(py39=["==3.9.*"], py310=["==3.10.*"], py311=["==3.11.*"])
2 changes: 1 addition & 1 deletion compose_chart_export/tests/test_chart_export/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
resources(name="reg", sources=["charts/*", "compose_files/*"])
python_tests(
dependencies=[":reg"],
interpreter_constraints=parametrize(py39=["==3.9.*"], py310=["==3.10.*"]),
interpreter_constraints=test_versions,
)
2 changes: 1 addition & 1 deletion model_lib/test/test_model_lib/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ resources(name="json", sources=["test_dump_functions/*.json"])
python_test_utils(name="conftest", resolve=parametrize("python-default", "pydantic-v1"))
python_tests(
dependencies=[":json"],
interpreter_constraints=parametrize(py39=["==3.9.*"], py310=["==3.10.*"]),
interpreter_constraints=test_versions,
# resolve=parametrize("python-default", "pydantic-v1")
)
7 changes: 5 additions & 2 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pants_version = "2.17.0rc3"
print_stacktrace = true
level = "warn"
build_file_prelude_globs = ["_pants/py_deploy.py", "_pants/py_package.py"]
build_file_prelude_globs = ["_pants/*.py"]

# for plugin development
pythonpath = ["%(buildroot)s/_pants/pants_py_deploy/src", "%(buildroot)s/compose_chart_export/src", "%(buildroot)s/docker_compose_parser/src", "%(buildroot)s/model_lib/src", "%(buildroot)s/zero_3rdparty/src"]
Expand Down Expand Up @@ -39,6 +39,9 @@ root_patterns = ["/*/src", "/*/", "/*/tests", "/*/test", "/_pants/*/src", "/_pan
interpreter_constraints=[">=3.9"]
enable_resolves = true

[python-infer]
use_rust_parser = true

[python.resolves]
pants-plugins = "_pants/3rdparty/lock.txt"
pydantic-v1 = "3rdparty/python/pydantic-v1.lock"
Expand All @@ -55,7 +58,7 @@ config = "pyproject.toml"
[mypy]
config = "pyproject.toml"
install_from_resolve="python-default"
interpreter_constraints=[">=3.10"]
interpreter_constraints=[">=3.11"]

[ruff]
config ="pyproject.toml"
Expand Down
2 changes: 1 addition & 1 deletion zero_3rdparty/tests/test_zero_3rdparty/BUILD
Original file line number Diff line number Diff line change
@@ -1 +1 @@
python_tests(interpreter_constraints=parametrize(py39=["==3.9.*"], py310=["==3.10.*"]))
python_tests(interpreter_constraints=test_versions)
Loading