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

Use pants.toml internally #9090

Merged
merged 8 commits into from
Feb 11, 2020
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ deploy:
skip_cleanup: true
env:
global:
- PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.ini"
- PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.toml"
- LC_ALL="en_US.UTF-8"
- BOOTSTRAPPED_PEX_BUCKET=ci-public.pantsbuild.org
- BOOTSTRAPPED_PEX_KEY_PREFIX=${TRAVIS_BUILD_NUMBER}/${TRAVIS_BUILD_ID}/pants.pex
Expand Down
4 changes: 2 additions & 2 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ files(
)

files(
name = 'pants_ini',
source = 'pants.ini',
name = 'pants_toml',
source = 'pants.toml',
)

files(
Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def pants_command(
"./pants.pex",
"--no-v1",
"--v2",
"--pants-config-files=pants.remote.ini",
"--pants-config-files=pants.remote.toml",
f"--remote-oauth-bearer-token-path={oauth_token_path}",
"test",
*sorted(targets),
Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/generate_travis_yml.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def all_entries(cls) -> List[Dict[str, str]]:
# ----------------------------------------------------------------------

GLOBAL_ENV_VARS = [
'PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.ini"',
'PANTS_CONFIG_FILES="${TRAVIS_BUILD_DIR}/pants.travis-ci.toml"',
'LC_ALL="en_US.UTF-8"',
'BOOTSTRAPPED_PEX_BUCKET=ci-public.pantsbuild.org',
'BOOTSTRAPPED_PEX_KEY_PREFIX=${TRAVIS_BUILD_NUMBER}/${TRAVIS_BUILD_ID}/pants.pex',
Expand Down
2 changes: 1 addition & 1 deletion build-support/docker/remote_execution/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# 4. $ docker build --tag rbe-remote-execution build-support/docker/remote_execution
# 5. $ docker tag rbe-remote-execution gcr.io/pants-remoting-beta/rbe-remote-execution
# 6. $ docker push gcr.io/pants-remoting-beta/rbe-remote-execution
# 7. Update `pants.remote.ini` to use the new SHA printed to the console.
# 7. Update `pants.remote.toml` to use the new SHA printed to the console.

FROM gcr.io/cloud-marketplace/google/rbe-ubuntu16-04@sha256:da0f21c71abce3bbb92c3a0c44c3737f007a82b60f8bd2930abc55fe64fc2729

Expand Down
2 changes: 1 addition & 1 deletion build-support/migration-support/migrate_to_toml_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def generate_new_config(config: Path) -> List[str]:
for i, line in enumerate(original_text_lines):
option_regex = r"(?P<option>[a-zA-Z0-9_]+)"
before_value_regex = rf"\s*{option_regex}\s*[:=]\s*"
valid_value_characters = r"a-zA-Z0-9_.@!%\=\>\<\-\(\)\/"
valid_value_characters = r"a-zA-Z0-9_.@!:%\=\>\<\-\(\)\/"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without this, we weren't properly converting options with : in the value, such as target: src/python:example.

value_regex = rf"(?P<value>[{valid_value_characters}]+)"
parsed_line = re.match(
rf"{before_value_regex}{value_regex}\s*$", line,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def test_fully_automatable_config() -> None:
[str_values]
normal: .isort.cfg
version: isort>=4.8
target: src/python:example
path: /usr/bin/test.txt
fromfile: @build-support/example.txt
interpolation: %(foo)s/example
Expand All @@ -47,6 +48,7 @@ def test_fully_automatable_config() -> None:
[str_values]
normal = ".isort.cfg"
version = "isort>=4.8"
target = "src/python:example"
path = "/usr/bin/test.txt"
fromfile = "@build-support/example.txt"
interpolation = "%(foo)s/example"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def test_bad_non_strict_override(self):

@rename_build_file
def test_bad_pants_ini_strict(self):
# thrift-linter fails if pants.ini has a thrift-linter:strict=True setting.
# thrift-linter fails if pants.toml has a thrift-linter:strict=True setting.
cmd = ['lint.thrift', self.thrift_test_target('bad-thrift-default')]
pants_ini_config = {'scrooge-linter': {'strict': True}}
pants_run = self.run_pants(cmd, config=pants_ini_config)
Expand All @@ -138,7 +138,7 @@ def test_bad_pants_ini_strict(self):

@rename_build_file
def test_bad_pants_ini_strict_overridden(self):
# thrift-linter passes if pants.ini has a thrift-linter:strict=True setting and
# thrift-linter passes if pants.toml has a thrift-linter:strict=True setting and
# a command line non-strict flag is passed.
cmd = ['--no-scrooge-linter-strict', 'lint.thrift', self.thrift_test_target('bad-thrift-default')]
pants_ini_config = {'scrooge-linter': {'strict': True}}
Expand Down
3 changes: 1 addition & 2 deletions pants.cache.ini → pants.cache.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# A config to globally enable caching for the purposes of manual testing.

[DEFAULT]
local_artifact_cache = %(buildroot)s/.buildcache

local_artifact_cache = "%(buildroot)s/.buildcache"

[cache]
read_from = ["%(local_artifact_cache)s"]
Expand Down
Loading