Skip to content

Commit

Permalink
Update pantsbuild(.org) -> pex-tool(.org). (#2359)
Browse files Browse the repository at this point in the history
Also add a bespoke CONTRIBUTING.md instead of pointing off to the
pantsbuild.org contributing docs.
  • Loading branch information
jsirois committed Feb 10, 2024
1 parent 79a4d86 commit 27c2db2
Show file tree
Hide file tree
Showing 372 changed files with 528 additions and 474 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ env:
_PEX_TEST_POS_ARGS: "--color --devpi --devpi-timeout 15.0 --shutdown-devpi -vvs"
# We use this to skip exposing same-versioned Pythons present on Linux hosts. These otherwise can
# collide when attempting to load libpython<major>.<minor><flags>.so and lead to mysterious errors
# importing builtins like `fcntl` as outlined in https://github.com/pantsbuild/pex/issues/1391.
# importing builtins like `fcntl` as outlined in https://github.com/pex-tool/pex/issues/1391.
_PEX_TEST_PYENV_VERSIONS: "2.7 3.7 3.10"
_PEX_PEXPECT_TIMEOUT: 10
concurrency:
Expand All @@ -18,7 +18,7 @@ concurrency:
jobs:
org-check:
name: Check GitHub Organization
if: github.repository_owner == 'pantsbuild'
if: github.repository_owner == 'pex-tool'
runs-on: ubuntu-22.04
steps:
- name: Noop
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
jobs:
org-check:
name: Check GitHub Organization
if: ${{ github.repository_owner == 'pantsbuild' }}
if: ${{ github.repository_owner == 'pex-tool' }}
runs-on: ubuntu-22.04
steps:
- name: Noop
Expand Down Expand Up @@ -125,7 +125,7 @@ jobs:
"type": "section",
"text": {
"type": "mrkdwn",
"text": "Pex ${{ needs.determine-tag.outputs.release-version }} is released:\n* https://pypi.org/project/pex/${{ needs.determine-tag.outputs.release-version }}/\n* https://github.com/pantsbuild/pex/releases/tag/${{ needs.determine-tag.outputs.release-tag }}"
"text": "Pex ${{ needs.determine-tag.outputs.release-version }} is released:\n* https://pypi.org/project/pex/${{ needs.determine-tag.outputs.release-version }}/\n* https://github.com/pex-tool/pex/releases/tag/${{ needs.determine-tag.outputs.release-tag }}"
}
}
]
Expand Down
12 changes: 6 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ contain those characters under PyPy3, Python 3.5 and Python 3.6.
This is another hotfix of the 2.1.48 release's `--layout` feature that
fixes identification of `--layout zipapp` PEXes that have had their
execute mode bit turned off. A notable example is the Pex PEX when
downloaded from <https://github.com/pantsbuild/pex/releases>.
downloaded from <https://github.com/pex-tool/pex/releases>.

* Fix zipapp layout identification. (#1448)

Expand Down Expand Up @@ -1712,7 +1712,7 @@ applications when specifying the `--unzip` option. PEXes built with
there already and then re-execute themselves from there. This can
improve startup latency. Pex itself now uses this mode in our [PEX
release](
https://github.com/pantsbuild/pex/releases/download/v2.1.8/pex).
https://github.com/pex-tool/pex/releases/download/v2.1.8/pex).

* Better support unzip mode PEXes. (#941)
* Support an unzip toggle for PEXes. (#939)
Expand All @@ -1731,7 +1731,7 @@ new support for control of the cache's runtime location with
control the cache's runtime location.

Unlike in the past, the [Pex PEX](
https://github.com/pantsbuild/pex/releases/download/v2.1.7/pex) we
https://github.com/pex-tool/pex/releases/download/v2.1.7/pex) we
release can now also be controlled via the `PEX_ROOT` environment
variable. Consult the CLI help for `--no-strip-pex-env`cto find out
more.
Expand Down Expand Up @@ -2448,7 +2448,7 @@ normalization.

* Add support for `.pexrc` files for influencing the pex environment.
See the notes [here](
https://github.com/pantsbuild/pex/blob/master/docs/buildingpex.rst#tailoring-pex-execution-at-build-time
https://github.com/pex-tool/pex/blob/master/docs/buildingpex.rst#tailoring-pex-execution-at-build-time
).
* Bug fix: PEX_PROFILE_FILENAME and PEX_PROFILE_SORT were not
respected.
Expand All @@ -2475,7 +2475,7 @@ normalization.
with default values that were not explicitly set in the environment.
Fixes #135.
* Bug fix: Since
[69649c1](https://github.com/pantsbuild/pex/commit/69649c1) we have
[69649c1](https://github.com/pex-tool/pex/commit/69649c1) we have
been un-patching the side effects of `sys.modules` after
`PEX.execute`. This takes all modules imported during the PEX
lifecycle and sets all their attributes to `None`. Unfortunately,
Expand Down Expand Up @@ -2622,7 +2622,7 @@ This is the last release before the 1.0.0 development branch is started.
[requests](https://github.com/kennethreitz/requests), improving both
performance and security. For more information, read the commit
notes at [91c7f32](
https://github.com/pantsbuild/pex/commit/91c7f324085c18af714d35947b603a5f60aeb682
https://github.com/pex-tool/pex/commit/91c7f324085c18af714d35947b603a5f60aeb682
).
* Improvements to API documentation throughout.
* Renamed `Tracer` to `TraceLogger` to prevent nondeterministic isort
Expand Down
58 changes: 58 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Contributing

First, thank you in advance for your time and effort!

## Constraints

Pex provides the `pex`, `pex3` and `pex-tools` tools via the [`pex` distribution on PyPI](
https://pypi.org/project/pex/) and the [`pex` PEX released on GitHub](
https://github.com/pex-tool/pex/releases/latest). Although there is no public code API (Pex is
supported as a CLI tool only), its stability guarantees for these scripts are paramount. Pex should
strictly adhere to [SEMVER 2.0](https://semver.org/) and never bump the major version. In other
words, changes should only fix bugs or add new features, never change existing features / the CLI
API (option names, meanings, etc.). As part of this guaranty, Pex must maintain support for all the
Pythons it has ever supported, namely CPython and PyPy for versions 2.7 and 3.5+. This means Pex
contributions are limited to Python 2.7 syntax and type hints using the comment style.

These hard constraints aside, Pex stays abreast of the latest as best as possible in the Python
packaging world. It always strives to support the latest Python and Pip releases either before they
reach a stable release or within a few days of one. As such, coverage of both Python interpreters
and Pip versions is broad in CI and most changes can proceed with confidence if CI goes green.

## Development Environment

You'll need just a few tools to hack on Pex:
+ The [`tox`](https://tox.wiki) tool.
+ (Optionally) Docker, or a Docker CLI clone like podman.

## Development Cycle

You might want to open a [discussion](https://github.com/pex-tool/pex/discussions) or [issue](
https://github.com/pex-tool/pex/issues) to vet your idea first. It can often save overall effort and
lead to a better end result.

Before sending off changes you should run `tox -e fmt,lint,check`. This formats, lints and type
checks the code.

In addition you should run tests, which are divided into integration tests (those under
`tests/integration/`) and unit tests (those under `tests/` but not under `tests/integration/`).
Unit tests have a tox environment name that matches the desired interpreter to test against. So, to
run unit tests against CPython 3.11 (which you must have installed), use `tox -e py311`. For
CPython 2.7 use `tox -e py27` and for PyPy 3.10 `tox -e pypy310`, etc. Integration tests follow the
same scheme with `-integration` appended to the environment name; so `tox -e py311-integration`,
`tox -epy27-integration`, `tox -e pypy310-integration`, etc. Both sets of test environments support
passing additional args to the test runner, which is a small shim around pytest. The shim supports
a `--devpi` option to have tests use a local [devpi server](https://pypi.org/project/devpi-server/)
caching proxy server. This generally helps with network flakes and is a friendly thing to do for
the PyPI maintainers. For example, `tox -e py312 -- --devpi -k just_this_test` would run unit tests
against CPython 3.12 using a devpi server and additionally just run the `just_this_test` test by
using pytest's `-k` test selector option.

If you have `docker` installed, you can use `./dtox.sh` in place of `tox` for any of the commands
described above. This will transparently pull or build a docker image on first execution that
contains all the Pythons Pex supports; so you can run the now exotic `./dtox.sh -e pypy27...`
without having to actually install PyPy 2.7 on your machine.

When you're ready to get additional eyes on your changes, submit a [pull request](
https://github.com/pex-tool/pex/pulls).

12 changes: 4 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
***
PEX
***
.. image:: https://github.com/pantsbuild/pex/workflows/CI/badge.svg?branch=main
:target: https://github.com/pantsbuild/pex/actions?query=branch%3Amain+workflow%3ACI
.. image:: https://github.com/pex-tool/pex/workflows/CI/badge.svg?branch=main
:target: https://github.com/pex-tool/pex/actions?query=branch%3Amain+workflow%3ACI
.. image:: https://img.shields.io/pypi/l/pex.svg
:target: https://pypi.org/project/pex/
.. image:: https://img.shields.io/pypi/v/pex.svg
Expand Down Expand Up @@ -167,13 +167,13 @@ running ``tox --listenvs-all``, then invoke like this:

.. code-block::
$ tox -e format-run
$ tox -e fmt
To run MyPy:

.. code-block::
$ tox -e typecheck
$ tox -e check
All of our tox test environments allow passthrough arguments, which can be helpful to run
specific tests:
Expand All @@ -188,7 +188,3 @@ To run Pex from source, rather than through what is on your PATH, invoke via Pyt
$ python -m pex
Contributing
============

To contribute, follow these instructions: https://www.pantsbuild.org/docs/contributor-overview
12 changes: 6 additions & 6 deletions RELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ Version Bump and Changelog
--------------------------

Bump the version in ``pex/version.py`` and update ``CHANGES.rst``. Open a PR with these changes and
land it on https://github.com/pantsbuild/pex main.
land it on https://github.com/pex-tool/pex main.

Release
=======

Push Release tag to Master
--------------------------

Sync a local branch with https://github.com/pantsbuild/pex main and confirm it has the version
Sync a local branch with https://github.com/pex-tool/pex main and confirm it has the version
bump and changelog update as the tip commit:

::
Expand All @@ -58,23 +58,23 @@ bump and changelog update as the tip commit:
pex/version.py | 2 +-
2 files changed, 18 insertions(+), 3 deletions(-)

Tag the release and push the tag to https://github.com/pantsbuild/pex main:
Tag the release and push the tag to https://github.com/pex-tool/pex main:

::

$ git tag --sign -am 'Release 2.1.29' v2.1.29
$ git push --tags https://github.com/pantsbuild/pex HEAD:main
$ git push --tags https://github.com/pex-tool/pex HEAD:main

If you're on macOS and commit signing fails, try setting ``export GPG_TTY=$(tty)``.

Open the Release workflow run and wait for it to go green:
https://github.com/pantsbuild/pex/actions?query=workflow%3ARelease+branch%3Av2.1.29
https://github.com/pex-tool/pex/actions?query=workflow%3ARelease+branch%3Av2.1.29

Edit the Github Release Page
----------------------------

Open the release page for edit:
https://github.com/pantsbuild/pex/releases/edit/v2.1.29
https://github.com/pex-tool/pex/releases/edit/v2.1.29

1. Copy and paste the most recent CHANGES.rst section.
2. Adapt the syntax from RestructuredText to Markdown (e.g. remove RST links ```PR #... <...>`_``).
2 changes: 1 addition & 1 deletion build-backend/pex_build/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2024 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).
2 changes: 1 addition & 1 deletion build-backend/pex_build/hatchling/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2024 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).
2 changes: 1 addition & 1 deletion build-backend/pex_build/hatchling/build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2024 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import absolute_import
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2024 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import absolute_import, print_function
Expand Down
2 changes: 1 addition & 1 deletion build-backend/pex_build/hatchling/hooks.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2024 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import absolute_import
Expand Down
4 changes: 2 additions & 2 deletions docker/cache/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# A data image with the necessary binaries and libraries to develop pex.

# Populate the ~/.pex_dev cache.
FROM ghcr.io/pantsbuild/pex/base:latest as cache
FROM ghcr.io/pex-tool/pex/base:latest as cache

ARG PEX_REPO=https://github.com/pantsbuild/pex
ARG PEX_REPO=https://github.com/pex-tool/pex
ARG GIT_REF=HEAD

# These must be set as a comma-separated list of all tox envs to cache.
Expand Down
2 changes: 1 addition & 1 deletion docker/user/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_IMAGE_TAG=latest
FROM ghcr.io/pantsbuild/pex/base:${BASE_IMAGE_TAG}
FROM ghcr.io/pex-tool/pex/base:${BASE_IMAGE_TAG}

# Prepare developer shim that can operate on local files and not mess up perms in the process.
ARG USER
Expand Down
2 changes: 1 addition & 1 deletion docs/_ext/vars.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2020 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from docutils import nodes, statemachine
Expand Down
2 changes: 1 addition & 1 deletion docs/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ process title so you see both the Python being used to run your PEX and the PEX
$ ./my.pex --foo bar &
$ ps -o command | grep pex
/home/jsirois/.pyenv/versions/3.10.2/bin/python3.10 /home/jsirois/dev/pantsbuild/jsirois-pex/my.pex --foo bar
/home/jsirois/.pyenv/versions/3.10.2/bin/python3.10 /home/jsirois/dev/pex-tool/pex/my.pex --foo bar
PEX app in a container
----------------------
Expand Down
20 changes: 10 additions & 10 deletions dtox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ BASE_INPUT=(
base_hash=$(cat "${BASE_INPUT[@]}" | git hash-object -t blob --stdin)

function base_image_id() {
docker image ls -q "ghcr.io/pantsbuild/pex/base:${base_hash}"
docker image ls -q "ghcr.io/pex-tool/pex/base:${base_hash}"
}

if [[ "${BASE_MODE}" == "build" && -z "$(base_image_id)" ]]; then
docker build \
--tag ghcr.io/pantsbuild/pex/base:latest \
--tag "ghcr.io/pantsbuild/pex/base:${base_hash}" \
--tag ghcr.io/pex-tool/pex/base:latest \
--tag "ghcr.io/pex-tool/pex/base:${base_hash}" \
"${ROOT}/docker/base"
elif [[ "${BASE_MODE}" == "pull" ]]; then
docker pull "ghcr.io/pantsbuild/pex/base:${base_hash}"
docker pull "ghcr.io/pex-tool/pex/base:${base_hash}"
fi

USER_INPUT=(
Expand All @@ -35,7 +35,7 @@ USER_INPUT=(
user_hash=$(cat "${USER_INPUT[@]}" | git hash-object -t blob --stdin)

function user_image_id() {
docker image ls -q "pantsbuild/pex/user:${user_hash}"
docker image ls -q "pex-tool/pex/user:${user_hash}"
}

if [[ -z "$(user_image_id)" ]]; then
Expand All @@ -45,8 +45,8 @@ if [[ -z "$(user_image_id)" ]]; then
--build-arg UID="$(id -u)" \
--build-arg GROUP="$(id -gn)" \
--build-arg GID="$(id -g)" \
--tag pantsbuild/pex/user:latest \
--tag "pantsbuild/pex/user:${user_hash}" \
--tag pex-tool/pex/user:latest \
--tag "pex-tool/pex/user:${user_hash}" \
"${ROOT}/docker/user"
fi

Expand All @@ -60,13 +60,13 @@ if [[ "${CACHE_MODE}" == "pull" ]]; then
docker run \
--rm \
--volume pex-caches:/development/pex_dev \
"ghcr.io/pantsbuild/pex/cache:${CACHE_TAG}" || true
"ghcr.io/pex-tool/pex/cache:${CACHE_TAG}" || true
docker run \
--rm \
--volume pex-caches:/development/pex_dev \
--entrypoint bash \
--user root \
"pantsbuild/pex/user:${user_hash}" \
"pex-tool/pex/user:${user_hash}" \
-c "chown -R $(id -u):$(id -g) /development/pex_dev"
fi

Expand Down Expand Up @@ -114,6 +114,6 @@ exec docker run \
--volume "${ROOT}:/development/pex" \
--volume pex-tox:/development/pex/.tox \
"${DOCKER_ARGS[@]}" \
"pantsbuild/pex/user:${user_hash}" \
"pex-tool/pex/user:${user_hash}" \
"$@"

2 changes: 1 addition & 1 deletion pex/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2014 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).
2 changes: 1 addition & 1 deletion pex/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2019 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2019 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import absolute_import
Expand Down
2 changes: 1 addition & 1 deletion pex/argparse.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2021 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import absolute_import
Expand Down
4 changes: 2 additions & 2 deletions pex/asserts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2024 Pants project contributors (see CONTRIBUTORS.md).
# Copyright 2024 Pex project contributors.
# Licensed under the Apache License, Version 2.0 (see LICENSE).

from __future__ import absolute_import
Expand Down Expand Up @@ -33,7 +33,7 @@
Firstly, please accept our apology!
If you could file an issue with the error and details above, we'd be
grateful. You can do that at https://github.com/pantsbuild/pex/issues/new and
grateful. You can do that at https://github.com/pex-tool/pex/issues/new and
redact or amend any details that expose sensitive information.
"""
).strip()
Expand Down
Loading

0 comments on commit 27c2db2

Please sign in to comment.