Skip to content

Upgrade to 2.0.0b0 #40

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

Merged
merged 5 commits into from
Sep 16, 2020
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
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@
# Python files
__pycache__/
*.pyc
/.venv/
.venv/

# Editors
.idea/
*.iml

# Local databases.
*.sqlite3
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ script:
- ./pants binary helloworld/main.py helloworld/main_py2.py
- ./pants run helloworld/main.py
- ./pants run helloworld/main_py2.py
- ./pants setup-py --args="bdist_wheel" helloworld/util:dist
- ./pants awslambda helloworld:helloworld-awslambda
# TODO: Fix PEX bug causing these to fail in CI, then reactivate when 2.0.0b1 is released.
# - ./pants setup-py --args="bdist_wheel" helloworld/util:dist
# - ./pants awslambda helloworld:helloworld-awslambda
25 changes: 25 additions & 0 deletions build-support/generate_constraints.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env bash
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

# See https://www.pantsbuild.org/v2.0/docs/python-third-party-dependencies.

set -euo pipefail

PYTHON_BIN=python3
VIRTUALENV=build-support/.venv
PIP="${VIRTUALENV}/bin/pip"
CONSTRAINTS_FILE=constraints.txt

"${PYTHON_BIN}" -m venv "${VIRTUALENV}"
"${PIP}" install pip --upgrade
"${PIP}" install -r <(./pants dependencies --type=3rdparty ::)
echo "# Generated by build-support/generate_constraints.sh on $(date)" > "${CONSTRAINTS_FILE}"
"${PIP}" freeze --all >> "${CONSTRAINTS_FILE}"

# This example repo includes some Python 2-only code for demonstration. Because we generated
# the constraints using Python 3.7, we must manually ensure things still work with Python 2.7. So,
# we warn to the user that they should check the diff. You can delete this if you don't use Python 2.
echo "Check the diff for ${CONSTRAINTS_FILE} and restore any entries that were specific to" \
"Python 2, i.e. entries ending in \`python_version == '2.7'\`. Those are needed for Python 2 to" \
"work properly, and this script will overwrite it." 1>&2
48 changes: 23 additions & 25 deletions constraints.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,36 @@
# Copyright 2020 Pants project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

# Generated by first creating a virtual environment with `python3.7 -m venv .venv`, then running
# `.venv/bin/pip install -r requirements.txt` and `.venv/bin/pip freeze`.

# Generated by build-support/generate_constraints.sh on Wed Sep 16 11:30:54 MST 2020
ansicolors==1.1.8
appdirs==1.4.3
certifi==2020.4.5.1
appdirs==1.4.4
certifi==2020.6.20
cfgv==2.0.1 ; python_version == '2.7'
cfgv==3.1.0 ; python_version > '2.7'
chardet==3.0.4
click==7.1.2
distlib==0.3.0
distlib==0.3.1
filelock==3.0.12
identify==1.4.15
idna==2.9
importlib-metadata==1.6.0
importlib-resources==1.5.0 ; python_version < '3.7'
lxml==4.5.0
nodeenv==1.3.5
packaging==20.3
identify==1.5.2
idna==2.10
importlib-metadata==1.7.0
importlib-resources==3.0.0
lxml==4.5.2
nodeenv==1.5.0
packaging==20.4
pip==20.2.3
pluggy==0.13.1
pre-commit==1.21.0 ; python_version == '2.7'
pre-commit==2.3.0 ; python_version > '2.7'
protobuf==3.11.3
py==1.8.1
pre-commit==2.7.1 ; python_version > '2.7'
protobuf==3.13.0
py==1.9.0
pyparsing==2.4.7
PyYAML==5.3.1
requests==2.23.0
six==1.14.0
toml==0.10.0
tox==3.15.0
requests==2.24.0
setuptools==44.1.1 ; python_version == '2.7'
setuptools==50.3.0 ; python_version > '2.7'
six==1.15.0
toml==0.10.1
tox==3.20.0
translate==3.5.0
urllib3==1.25.9
virtualenv==20.0.20
urllib3==1.25.10
virtualenv==20.0.31
zipp==1.2.0 ; python_version == '2.7'
zipp==3.1.0 ; python_version > '2.7'
9 changes: 8 additions & 1 deletion pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

[GLOBAL]
pants_version = "2.0.0.dev9"
pants_version = "2.0.0b0"
pantsd = true # Enable the Pants daemon for better performance.

backend_packages.add = [
Expand All @@ -15,10 +15,17 @@ backend_packages.add = [
'pants.backend.python.lint.isort',
]

# This ensures that the result of `./pants binary` is always unique.
pants_distdir_legacy_paths = false

[source]
# The Python source root is the repo root. See https://www.pantsbuild.org/docs/source-roots.
root_patterns = ["/"]

[subprocess-environment]
# We pass through these environment variables to subprocesses.
env_vars = ["LANG", "LC_ALL"]
Comment on lines +25 to +27
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both of the edits in pants.toml seem like maybe they would make good defaults... especially this one, since it seems like Python code will break without them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strong +1 on this one with LANG and LC_ALL. Originally, I was concerned that it's then hard to add your own values to this option. But I realized that I'm not concerned about that, thanks to the syntax env_vars.add.

@benjyw what do you think?


[python-setup]
# The default interpreter compatibility for code in this repo. Individual targets can ovverride
# this with the `compatibility` field. See
Expand Down