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

Create a top-level pants_release package. #19297

Merged
merged 1 commit into from
Jun 12, 2023
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
19 changes: 10 additions & 9 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ jobs:
- env:
PANTS_CONFIG_FILES: +['pants.ci.toml','pants.ci.aarch64.toml']
name: Build wheels
run: './pants run build-support/bin/release.py -- build-local-pex
run: './pants run src/python/pants_release/release.py -- build-local-pex

./pants run build-support/bin/release.py -- build-wheels
./pants run src/python/pants_release/release.py -- build-wheels

'
- continue-on-error: true
Expand Down Expand Up @@ -103,9 +103,9 @@ jobs:
go-version: 1.19.5
- env: {}
name: Build wheels
run: './pants run build-support/bin/release.py -- build-local-pex
run: './pants run src/python/pants_release/release.py -- build-local-pex

./pants run build-support/bin/release.py -- build-wheels
./pants run src/python/pants_release/release.py -- build-wheels

'
- continue-on-error: true
Expand Down Expand Up @@ -162,9 +162,9 @@ jobs:
- env:
ARCHFLAGS: -arch x86_64
name: Build wheels
run: './pants run build-support/bin/release.py -- build-local-pex
run: './pants run src/python/pants_release/release.py -- build-local-pex

./pants run build-support/bin/release.py -- build-wheels
./pants run src/python/pants_release/release.py -- build-wheels

'
- continue-on-error: true
Expand Down Expand Up @@ -221,9 +221,9 @@ jobs:
- env:
ARCHFLAGS: -arch arm64
name: Build wheels
run: './pants run build-support/bin/release.py -- build-local-pex
run: './pants run src/python/pants_release/release.py -- build-local-pex

./pants run build-support/bin/release.py -- build-wheels
./pants run src/python/pants_release/release.py -- build-wheels

'
- continue-on-error: true
Expand Down Expand Up @@ -278,7 +278,8 @@ jobs:
- env:
MODE: debug
name: Fetch and stabilize wheels
run: ./pants run build-support/bin/release.py -- fetch-and-stabilize --dest=dest/pypi_release
run: ./pants run src/python/pants_release/release.py -- fetch-and-stabilize
--dest=dest/pypi_release
- name: Create Release -> Commit Mapping
run: 'tag="${{ needs.determine_ref.outputs.build-ref }}"

Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,9 @@ jobs:
- env:
PANTS_CONFIG_FILES: +['pants.ci.toml','pants.ci.aarch64.toml']
name: Build wheels
run: './pants run build-support/bin/release.py -- build-local-pex
run: './pants run src/python/pants_release/release.py -- build-local-pex

./pants run build-support/bin/release.py -- build-wheels
./pants run src/python/pants_release/release.py -- build-wheels

'
- continue-on-error: true
Expand Down Expand Up @@ -369,9 +369,9 @@ jobs:
go-version: 1.19.5
- env: {}
name: Build wheels
run: './pants run build-support/bin/release.py -- build-local-pex
run: './pants run src/python/pants_release/release.py -- build-local-pex

./pants run build-support/bin/release.py -- build-wheels
./pants run src/python/pants_release/release.py -- build-wheels

'
- continue-on-error: true
Expand Down Expand Up @@ -424,9 +424,9 @@ jobs:
- env:
ARCHFLAGS: -arch x86_64
name: Build wheels
run: './pants run build-support/bin/release.py -- build-local-pex
run: './pants run src/python/pants_release/release.py -- build-local-pex

./pants run build-support/bin/release.py -- build-wheels
./pants run src/python/pants_release/release.py -- build-wheels

'
- continue-on-error: true
Expand Down Expand Up @@ -479,9 +479,9 @@ jobs:
- env:
ARCHFLAGS: -arch arm64
name: Build wheels
run: './pants run build-support/bin/release.py -- build-local-pex
run: './pants run src/python/pants_release/release.py -- build-local-pex

./pants run build-support/bin/release.py -- build-wheels
./pants run src/python/pants_release/release.py -- build-wheels

'
- continue-on-error: true
Expand Down
1 change: 0 additions & 1 deletion build-support/bin/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ python_sources(
python_tests(
name="py_tests",
overrides={
"reversion_test.py": {"timeout": 90, "dependencies": ["3rdparty/python#pex"]},
"generate_json_schema_test.py": {
"dependencies": [
"build-support/bin/json_schema_testdata:json_schema_samples",
Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
from textwrap import dedent

import requests
from common import die
from packaging.version import Version
from pants_release.common import die

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/check_banned_imports.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from glob import glob
from typing import Iterable

from common import die
from pants_release.common import die


def main() -> None:
Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/check_inits.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import itertools
from pathlib import Path

from common import die
from pants_release.common import die

DIRS_TO_CHECK = (
"src/python",
Expand Down
3 changes: 2 additions & 1 deletion build-support/bin/classify_changed_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ class Affected(enum.Enum):
"src/python/pants/VERSION",
"src/python/pants/init/BUILD",
"src/python/pants/notes/*",
"build-support/bin/release.py",
"src/python/pants_release/release.py",
"src/python/pants_release/reversion.py",
]
_ci_config_globs = [
"build-support/bin/classify_changed_files.py",
Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/copy_to_s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import subprocess
from pathlib import PurePath

from common import die
from pants_release.common import die

logger = logging.getLogger(__name__)

Expand Down
2 changes: 1 addition & 1 deletion build-support/bin/generate_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

import chevron
import requests
from common import die
from pants_release.common import die
from readme_api import DocRef, ReadmeAPI

from pants.base.build_environment import get_buildroot, get_pants_cachedir
Expand Down
8 changes: 4 additions & 4 deletions build-support/bin/generate_github_workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import toml
import yaml
from common import die
from pants_release.common import die

from pants.util.strutil import softwrap

Expand Down Expand Up @@ -525,8 +525,8 @@ def build_wheels(self) -> list[Step]:
# it cleans out `dist/deploy`, which the build-wheels runs populate for
# later attention by deploy_to_s3.py.
"""\
./pants run build-support/bin/release.py -- build-local-pex
./pants run build-support/bin/release.py -- build-wheels
./pants run src/python/pants_release/release.py -- build-local-pex
./pants run src/python/pants_release/release.py -- build-wheels
"""
)

Expand Down Expand Up @@ -1057,7 +1057,7 @@ def release_jobs_and_inputs() -> tuple[Jobs, dict[str, Any]]:
*helper.expose_all_pythons(),
{
"name": "Fetch and stabilize wheels",
"run": f"./pants run build-support/bin/release.py -- fetch-and-stabilize --dest={pypi_release_dir}",
"run": f"./pants run src/python/pants_release/release.py -- fetch-and-stabilize --dest={pypi_release_dir}",
"env": {
# This step does not actually build anything: only download wheels from S3.
"MODE": "debug",
Expand Down
6 changes: 3 additions & 3 deletions docs/markdown/Contributions/releases/release-process.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ First, ensure that you are on your release branch at your version bump commit.
Then, run:

```bash
./pants run build-support/bin/release.py -- tag-release
./pants run src/python/pants_release/release.py -- tag-release
```

This will tag the release with your PGP key, and push the tag to origin, which will kick off a [`Release` job](https://github.com/pantsbuild/pants/actions/workflows/release.yaml) to build the wheels and publish them to PyPI.
Expand All @@ -209,7 +209,7 @@ Step 4: Release a Pants PEX
After the [`Release` job](https://github.com/pantsbuild/pants/actions/workflows/release.yaml) for your tag has completed, you should additionally build and publish the "universal" PEX to Github.

```bash
PANTS_PEX_RELEASE=STABLE ./pants run build-support/bin/release.py -- build-universal-pex
PANTS_PEX_RELEASE=STABLE ./pants run src/python/pants_release/release.py -- build-universal-pex
```

Then:
Expand All @@ -226,7 +226,7 @@ Step 5: Test the release
Run this script as a basic smoke test:

```bash
./pants run build-support/bin/release.py -- test-release
./pants run src/python/pants_release/release.py -- test-release
```

You should also [check PyPI](https://pypi.org/pypi/pantsbuild.pants) to ensure everything looks good. Click "Release history" to find the version you released, then click it and confirm the changelog is correct on the "Project description" page and that the `macOS` and `manylinux` wheels show up in the "Download files" page.
Expand Down
11 changes: 11 additions & 0 deletions src/python/pants_release/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2023 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).

python_sources()

python_tests(
name="test",
overrides={
"reversion_test.py": {"timeout": 90, "dependencies": ["3rdparty/python#pex"]},
},
)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
from xml.etree import ElementTree

import requests
from common import banner, die, green
from packaging.version import Version
from reversion import reversion
from pants_release.common import banner, die, green
from pants_release.reversion import reversion

from pants.util.contextutil import temporary_dir
from pants.util.memo import memoized_property
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from pathlib import Path

import requests
from reversion import reversion
from pants_release.reversion import reversion


def test_reversion(tmp_path: Path) -> None:
Expand Down
Loading