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

Update pants and pants.toml for 2.0 release #26

Merged
merged 5 commits into from
Jul 24, 2020
Merged

Update pants and pants.toml for 2.0 release #26

merged 5 commits into from
Jul 24, 2020

Conversation

danieljanes
Copy link
Contributor

@danieljanes danieljanes commented Jul 22, 2020

This PR is in preparation for the Pants 2.0.0 release. It's in draft mode because 2.0 is not stable yet, but it could be merged once that changes.

The PR is intended to
(a) serve as a working example for people who want to explore Pants 2.0
(b) show the diff between a working 1.x and 2.0 configuration

Progress:

  • Right now, the upgrade to 2.0.0.dev4 still fails: ./pants list :: raises 31 rules errors - any feedback is appreciated
  • Update: According to @stuhood the failure seems to be related to protoc not being ready for 2.0 yet (Loading pants.backend.codegen.protobuf.python fails in dev releases pants#10425)
  • Update 2: Downgrading to 2.0.0.dev2 fixed the issue
  • Update 3: The new 2.0.0.dev5 fixes the regression, everything seems to work on the latest dev release now

pants.toml Show resolved Hide resolved
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thank you! Could you please apply this diff as well to update ./pants_from_sources?

diff --git a/pants_from_sources b/pants_from_sources
index 08de322..733aae1 100755
--- a/pants_from_sources
+++ b/pants_from_sources
@@ -36,10 +36,10 @@ function string_list() {
 }

 export PANTS_VERSION="$(cat "${PANTS_SOURCE}/src/python/pants/VERSION")"
-export PANTS_PLUGINS2="$(string_list plugins)"
+export PANTS_PLUGINS="$(string_list plugins)"
 export PANTS_PYTHONPATH="+$(string_list pythonpath)"
-export PANTS_BACKEND_PACKAGES2="+$(string_list backend_packages)"
-export PANTS_ENABLE_PANTSD="${ENABLE_PANTSD}"
+export PANTS_BACKEND_PACKAGES="+$(string_list backend_packages)"
+export PANTS_PANTSD="${ENABLE_PANTSD}"
 export no_proxy="*"

 exec "${PANTS_SOURCE}/pants" "--no-verify-config" "$@"

pants.toml Outdated Show resolved Hide resolved
@danieljanes
Copy link
Contributor Author

Thank you! Could you please apply this diff as well to update ./pants_from_sources?

diff --git a/pants_from_sources b/pants_from_sources
index 08de322..733aae1 100755
--- a/pants_from_sources
+++ b/pants_from_sources
@@ -36,10 +36,10 @@ function string_list() {
 }

 export PANTS_VERSION="$(cat "${PANTS_SOURCE}/src/python/pants/VERSION")"
-export PANTS_PLUGINS2="$(string_list plugins)"
+export PANTS_PLUGINS="$(string_list plugins)"
 export PANTS_PYTHONPATH="+$(string_list pythonpath)"
-export PANTS_BACKEND_PACKAGES2="+$(string_list backend_packages)"
-export PANTS_ENABLE_PANTSD="${ENABLE_PANTSD}"
+export PANTS_BACKEND_PACKAGES="+$(string_list backend_packages)"
+export PANTS_PANTSD="${ENABLE_PANTSD}"
 export no_proxy="*"

 exec "${PANTS_SOURCE}/pants" "--no-verify-config" "$@"

Done

@Eric-Arellano
Copy link
Contributor

Thank you @danieljanes for iterating on this! Looks great. Right now, it's targeted to merge into the master branch. I pushed a new branch called 2.0. Could you please change this PR to merge into 2.0? I'm not sure if you can change that when already created - it may require creating a new PR.

@danieljanes danieljanes changed the base branch from master to 2.0 July 24, 2020 06:09
@danieljanes
Copy link
Contributor Author

danieljanes commented Jul 24, 2020

Thank you @danieljanes for iterating on this! Looks great. Right now, it's targeted to merge into the master branch. I pushed a new branch called 2.0. Could you please change this PR to merge into 2.0? I'm not sure if you can change that when already created - it may require creating a new PR.

Thanks @Eric-Arellano! I've changed the target to 2.0 (it's possible to do this on existing PRs). Since we have the 2.0 branch target I've also updated the state from "draft" to "ready for review".

@danieljanes danieljanes marked this pull request as ready for review July 24, 2020 12:59
Copy link
Contributor

@Eric-Arellano Eric-Arellano left a comment

Choose a reason for hiding this comment

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

Thank you!

@Eric-Arellano Eric-Arellano merged commit 6ca87cb into pantsbuild:2.0 Jul 24, 2020
asherf referenced this pull request in asherf/example-python Aug 20, 2020
asherf referenced this pull request in toolchainlabs/example-python Sep 2, 2020
* Update `pants` and `pants.toml` for 2.0 release (#26)

* Fix the setup-py part of the example. (#30)

Required moving the .proto files to be
below the exported target (in the filesystem
sense).

If we support setting a source root on
generated protos in the future, we can
modify this further to demo that.

* Upgrade to 2.0.0.dev7 (pantsbuild#33)

Remaining followups:

* [ ] Fix `./pants run helloworld/main.py` failing due to import error. Test it in CI.
* [ ] Turn on dependency inference. Needs docs update.
* [ ] Enable MyPy.
* [ ] Possibly change Protobuf structure to show off the new `python_source_root` plugin field. Needs docs update.
* [ ] Use `resolve_all_constraints`. Needs docs update.
* [ ] Fix all references to readme.io. Fix the `master` branch too.
* [ ] Update the `./pants` script. Fix the `master` branch too.

* Update doc URLs to pantsbuild.org (pantsbuild#35)

* Upgrade to 2.0.0.dev8 (pantsbuild#37)

* Disable failing command.

Co-authored-by: Daniel J. Beutel <daniel@adap.com>
Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
asherf referenced this pull request in toolchainlabs/example-python Nov 13, 2020
* Update `pants` and `pants.toml` for 2.0 release (#26)

* Fix the setup-py part of the example. (#30)

Required moving the .proto files to be
below the exported target (in the filesystem
sense).

If we support setting a source root on
generated protos in the future, we can
modify this further to demo that.

* Upgrade to 2.0.0.dev7 (pantsbuild#33)

Remaining followups:

* [ ] Fix `./pants run helloworld/main.py` failing due to import error. Test it in CI.
* [ ] Turn on dependency inference. Needs docs update.
* [ ] Enable MyPy.
* [ ] Possibly change Protobuf structure to show off the new `python_source_root` plugin field. Needs docs update.
* [ ] Use `resolve_all_constraints`. Needs docs update.
* [ ] Fix all references to readme.io. Fix the `master` branch too.
* [ ] Update the `./pants` script. Fix the `master` branch too.

* Update doc URLs to pantsbuild.org (pantsbuild#35)

* Upgrade to 2.0.0.dev8 (pantsbuild#37)

* Add py2 __init__.py files. (pantsbuild#39)

Otherwise `./pants run helloworld:helloworld_py2` doesn't work.

* Upgrade to Pants 2.0.0.dev9 (pantsbuild#38)

* Upgrade to 2.0.0b0 (pantsbuild#40)

* Turn on dependency inference (pantsbuild#41)

* update ./pants wrapper with PANTS_SHA support (pantsbuild#42)

Update the ./pants wrapper to add support for specifying a main branch version of Pants via PANTS_SHA.

* Upgrade to 2.0.0b1 (pantsbuild#44)

* Upgrade to 2.0.0b3 (pantsbuild#45)

* Upgrade to 2.0.0rc0 (pantsbuild#46)

* Enable MyPy (pantsbuild#47)

This shows off the MyPy Protobuf plugin and partitioning based on interpreter constraints.

* Upgrade to 2.0.0rc1 (pantsbuild#48)

This corresponds to an updated entry for https://www.pantsbuild.org/docs/python-interpreter-compatibility#changing-the-interpreter-search-path.

* Upgrade to 2.0.0rc2 (pantsbuild#49)

* Bump to 2.0.0rc3. (pantsbuild#50)

* Upgrade to 2.0.0 (pantsbuild#51)

* Upgrade to 2.1.0rc0 (pantsbuild#52)

* Update to the latest `./pants` script (pantsbuild#53)

This prepares us for 2.2 removing support for running with Py36.

* add missing BUILD file.

Co-authored-by: Daniel J. Beutel <daniel@adap.com>
Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Tom Dyas <tom.dyas@gmail.com>
Co-authored-by: Tom Dyas <tdyas@toolchain.com>
Co-authored-by: Stu Hood <stuhood@gmail.com>
asherf referenced this pull request in toolchainlabs/example-python Nov 18, 2020
* Update `pants` and `pants.toml` for 2.0 release (#26)

* Fix the setup-py part of the example. (#30)

Required moving the .proto files to be
below the exported target (in the filesystem
sense).

If we support setting a source root on
generated protos in the future, we can
modify this further to demo that.

* Upgrade to 2.0.0.dev7 (pantsbuild#33)

Remaining followups:

* [ ] Fix `./pants run helloworld/main.py` failing due to import error. Test it in CI.
* [ ] Turn on dependency inference. Needs docs update.
* [ ] Enable MyPy.
* [ ] Possibly change Protobuf structure to show off the new `python_source_root` plugin field. Needs docs update.
* [ ] Use `resolve_all_constraints`. Needs docs update.
* [ ] Fix all references to readme.io. Fix the `master` branch too.
* [ ] Update the `./pants` script. Fix the `master` branch too.

* Update doc URLs to pantsbuild.org (pantsbuild#35)

* Upgrade to 2.0.0.dev8 (pantsbuild#37)

* Add py2 __init__.py files. (pantsbuild#39)

Otherwise `./pants run helloworld:helloworld_py2` doesn't work.

* Upgrade to Pants 2.0.0.dev9 (pantsbuild#38)

* Upgrade to 2.0.0b0 (pantsbuild#40)

* Turn on dependency inference (pantsbuild#41)

* update ./pants wrapper with PANTS_SHA support (pantsbuild#42)

Update the ./pants wrapper to add support for specifying a main branch version of Pants via PANTS_SHA.

* Upgrade to 2.0.0b1 (pantsbuild#44)

* Upgrade to 2.0.0b3 (pantsbuild#45)

* Upgrade to 2.0.0rc0 (pantsbuild#46)

* Enable MyPy (pantsbuild#47)

This shows off the MyPy Protobuf plugin and partitioning based on interpreter constraints.

* Upgrade to 2.0.0rc1 (pantsbuild#48)

This corresponds to an updated entry for https://www.pantsbuild.org/docs/python-interpreter-compatibility#changing-the-interpreter-search-path.

* Upgrade to 2.0.0rc2 (pantsbuild#49)

* Bump to 2.0.0rc3. (pantsbuild#50)

* Upgrade to 2.0.0 (pantsbuild#51)

* Upgrade to 2.1.0rc0 (pantsbuild#52)

* Update to the latest `./pants` script (pantsbuild#53)

This prepares us for 2.2 removing support for running with Py36.

Co-authored-by: Daniel J. Beutel <daniel@adap.com>
Co-authored-by: Benjy Weinberger <benjyw@gmail.com>
Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com>
Co-authored-by: Tom Dyas <tom.dyas@gmail.com>
Co-authored-by: Tom Dyas <tdyas@toolchain.com>
Co-authored-by: Stu Hood <stuhood@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants