Skip to content
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
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ install:
script:
- ./pants --changed-since=origin/master lint
- ./pants --changed-since=origin/master --changed-include-dependees=transitive test
# Smoke test that our release process will work.
- ./pants binary helloworld/main.py helloworld/main_py2.py

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We should also actually run these binaries (once they run successfully again).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, agreed. This is a TODO in the PR description.

- ./pants setup-py --args="bdist_wheel" helloworld/util:dist
- ./pants awslambda helloworld:helloworld-awslambda
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Try these out in this repo!
## Run `setup.py` commands

```
./pants setup-py --args="bdist_wheel" helloworld/util # Build a wheel.
./pants setup-py --args="bdist_wheel" helloworld/util:dist # Build a wheel.
```

## Build an AWS Lambda
Expand Down
27 changes: 16 additions & 11 deletions helloworld/util/BUILD
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
# Copyright 2020 Pants project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

# See https://pants.readme.io/docs/python-setup-py-goal.
python_distribution(
name="dist",
dependencies=[":util"],
provides=setup_py(
name='helloworld.util',
version='0.0.1',
description='Greeting library utilities.',
),
)

python_library(
# `name` defaults to the name of this directory, i.e., `util`.
# `sources` defaults to ['*.py', '!*_test.py', '!test_*.py', '!conftest.py'].
dependencies = [
dependencies=[
"//:setuptools",
"//:translate",
"helloworld/util/proto",
],
# See https://pants.readme.io/docs/python-setup-py-goal.
provides = setup_py(
name='helloworld.util',
version='0.0.1',
description='Greeting library utilities.',
),
)

python_tests(
name = 'tests',
name='tests',
# `sources` defaults to ['*_test.py', 'test_*.py', 'conftest.py'].
dependencies = [
dependencies=[
":config_loader_test_data",
":util",
],
)

resources(
name = 'config_loader_test_data',
sources = ['config_loader_test_data.json'],
name='config_loader_test_data',
sources=['config_loader_test_data.json'],
)
5 changes: 4 additions & 1 deletion pants.ci.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright 2020 Pants project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

# See https://pants.readme.io/docs/using-pants-in-ci.

[GLOBAL]
Expand All @@ -6,7 +9,7 @@ pantsd = false
# Limit the maximum number of concurrent processes. Change this
# to a number that makes sense for your CI setup, based on
# the number of cores/threads.
process_execution_local_parallelism = 4
process_execution_local_parallelism = 2

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why not just omit this entirely? The default is probably sound. Or at least comment that the default is equal to the number of cores reported by the system.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Because this is likely something people will want to tune, and we want to highlight that it's an option.


[python-setup]
# Limit the maximum number of concurrent jobs used to resolve third
Expand Down
9 changes: 4 additions & 5 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
# Licensed under the Apache License, Version 2.0 (see LICENSE).

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

# List backends here.
backend_packages.add = [
'pants.backend.awslambda.python',
'pants.backend.codegen.protobuf.python',
Expand All @@ -16,9 +15,6 @@ backend_packages.add = [
'pants.backend.python.lint.isort',
]

# List plugins here.
plugins = []

[source]
# The Python source root is the repo root. See https://pants.readme.io/docs/source-roots.
root_patterns = ["/"]
Expand All @@ -39,3 +35,6 @@ config = ".flake8"

[isort]
config = [".isort.cfg"]

[python-infer]
imports = false