From eecda2f1e94dd9b23ad4c4842698e02428d4e313 Mon Sep 17 00:00:00 2001 From: Ruben Arts Date: Thu, 19 Sep 2024 15:12:37 +0200 Subject: [PATCH] chore: version to 0.30.0 (#2085) --- CHANGELOG.md | 60 +++++++ CITATION.cff | 4 +- Cargo.lock | 2 +- Cargo.toml | 2 +- crates/pixi_consts/src/consts.rs | 2 +- docs/advanced/github_actions.md | 2 +- install/install.ps1 | 2 +- install/install.sh | 2 +- schema/schema.json | 4 +- scripts/release.py | 266 +++++++++++++++++++++++-------- src/cli/mod.rs | 2 +- tbump.toml | 6 +- tests/integration/common.py | 2 +- 13 files changed, 271 insertions(+), 85 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8bcf28eae..d01023c11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,66 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +### [0.30.0] - 2024-09-19 +#### ✨ Highlights +I want to thank @synapticarbors and @abkfenris for starting the work on `pixi project export`. +Pixi now supports the export of a conda `environment.yml` file and a conda explicit specification file. +This is a great addition to the project and will help users to share their projects with other non pixi users. + +#### Added +- Export conda explicit specification file from project by @synapticarbors in [#1873](https://github.com/prefix-dev/pixi/pull/1873) +- Add flag to `pixi search` by @Hofer-Julian in [#2018](https://github.com/prefix-dev/pixi/pull/2018) +- Adds the ability to set the index strategy by @tdejager in [#1986](https://github.com/prefix-dev/pixi/pull/1986) +- Export conda `environment.yml` by @abkfenris in [#2003](https://github.com/prefix-dev/pixi/pull/2003) + +#### Changed +- Improve examples/docker by @jennydaman in [#1965](https://github.com/prefix-dev/pixi/pull/1965) +- Minimal pre-commit tasks by @Hofer-Julian in [#1984](https://github.com/prefix-dev/pixi/pull/1984) +- Improve error and feedback when target does not exist by @tdejager in [#1961](https://github.com/prefix-dev/pixi/pull/1961) +- Move the rectangle using a mouse in SDL by @certik in [#2069](https://github.com/prefix-dev/pixi/pull/2069) + +#### Documentation +- Update cli.md by @xela-95 in [#2047](https://github.com/prefix-dev/pixi/pull/2047) +- Update `system-requirements` information by @ruben-arts in [#2079](https://github.com/prefix-dev/pixi/pull/2079) +- Append to file syntax in task docs by @nicornk in [#2013](https://github.com/prefix-dev/pixi/pull/2013) +- Change documentation of pixi upload to refer to correct API endpoint by @traversaro in [#2074](https://github.com/prefix-dev/pixi/pull/2074) + +#### Testing +- Add downstream nerfstudio test by @tdejager in [#1996](https://github.com/prefix-dev/pixi/pull/1996) +- Run pytests in parallel by @tdejager in [#2027](https://github.com/prefix-dev/pixi/pull/2027) +- Testing common wheels by @tdejager in [#2031](https://github.com/prefix-dev/pixi/pull/2031) + +#### Fixed +- Lock file is always outdated for pypi path dependencies by @nichmor in [#2039](https://github.com/prefix-dev/pixi/pull/2039) +- Fix error message for export conda explicit spec by @synapticarbors in [#2048](https://github.com/prefix-dev/pixi/pull/2048) +- Use `conda-pypi-map` for feature channels by @nichmor in [#2038](https://github.com/prefix-dev/pixi/pull/2038) +- Constrain feature platforms in schema by @bollwyvl in [#2055](https://github.com/prefix-dev/pixi/pull/2055) +- Split tag creation functions by @tdejager in [#2062](https://github.com/prefix-dev/pixi/pull/2062) +- Tree print to pipe by @ruben-arts in [#2064](https://github.com/prefix-dev/pixi/pull/2064) +- `subdirectory` in pypi url by @ruben-arts in [#2065](https://github.com/prefix-dev/pixi/pull/2065) +- Create a GUI application on Windows, not Console by @certik in [#2067](https://github.com/prefix-dev/pixi/pull/2067) +- Make dashes underscores in python package names by @ruben-arts in [#2073](https://github.com/prefix-dev/pixi/pull/2073) +- Give better errors on broken `pyproject.toml` by @ruben-arts in [#2075](https://github.com/prefix-dev/pixi/pull/2075) + +#### Refactor +- Stop duplicating `strip_channel_alias` from rattler by @Hofer-Julian in [#2017](https://github.com/prefix-dev/pixi/pull/2017) +- Follow-up wheels tests by @Hofer-Julian in [#2063](https://github.com/prefix-dev/pixi/pull/2063) +- Integration test suite by @Hofer-Julian in [#2081](https://github.com/prefix-dev/pixi/pull/2081) +- Remove `psutils` by @Hofer-Julian in [#2083](https://github.com/prefix-dev/pixi/pull/2083) +- Add back older caching method by @tdejager in [#2046](https://github.com/prefix-dev/pixi/pull/2046) +- Release script by @Hofer-Julian in [#1978](https://github.com/prefix-dev/pixi/pull/1978) +- Activation script by @Hofer-Julian in [#2014](https://github.com/prefix-dev/pixi/pull/2014) +- Pins python version in add_pypi_functionality by @tdejager in [#2040](https://github.com/prefix-dev/pixi/pull/2040) +- Improve the lock_file_usage flags and behavior. by @ruben-arts in [#2078](https://github.com/prefix-dev/pixi/pull/2078) +- Move matrix to workflow that it is used in by @tdejager in [#1987](https://github.com/prefix-dev/pixi/pull/1987) +- Refactor manifest into more generic approach by @nichmor in [#2015](https://github.com/prefix-dev/pixi/pull/2015) + +#### New Contributors +* @certik made their first contribution in [#2069](https://github.com/prefix-dev/pixi/pull/2069) +* @xela-95 made their first contribution in [#2047](https://github.com/prefix-dev/pixi/pull/2047) +* @nicornk made their first contribution in [#2013](https://github.com/prefix-dev/pixi/pull/2013) +* @jennydaman made their first contribution in [#1965](https://github.com/prefix-dev/pixi/pull/1965) + ### [0.29.0] - 2024-09-04 #### ✨ Highlights diff --git a/CITATION.cff b/CITATION.cff index 73f49302d..1625ca7a9 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -24,8 +24,8 @@ authors: name-particle: de family-names: Jager email: tdejager89@gmail.com -repository-code: 'https://github.com/prefix-dev/pixi/releases/tag/v0.29.0' -url: 'https://pixi.sh/v0.29.0' +repository-code: 'https://github.com/prefix-dev/pixi/releases/tag/v0.30.0' +url: 'https://pixi.sh/v0.30.0' abstract: >- A cross-platform, language agnostic, package/project management tool for development in virtual environments. diff --git a/Cargo.lock b/Cargo.lock index 1ec757242..472c84c24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3372,7 +3372,7 @@ dependencies = [ [[package]] name = "pixi" -version = "0.29.0" +version = "0.30.0" dependencies = [ "ahash 0.8.11", "assert_matches", diff --git a/Cargo.toml b/Cargo.toml index 1787bf287..97f73a042 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -141,7 +141,7 @@ license.workspace = true name = "pixi" readme.workspace = true repository.workspace = true -version = "0.29.0" +version = "0.30.0" [features] default = ["rustls-tls"] diff --git a/crates/pixi_consts/src/consts.rs b/crates/pixi_consts/src/consts.rs index 478185063..313d16979 100644 --- a/crates/pixi_consts/src/consts.rs +++ b/crates/pixi_consts/src/consts.rs @@ -12,7 +12,7 @@ pub const PYPROJECT_MANIFEST: &str = "pyproject.toml"; pub const PROJECT_LOCK_FILE: &str = "pixi.lock"; pub const CONFIG_FILE: &str = "config.toml"; pub const PIXI_DIR: &str = ".pixi"; -pub const PIXI_VERSION: &str = "0.29.0"; +pub const PIXI_VERSION: &str = "0.30.0"; pub const PREFIX_FILE_NAME: &str = "pixi_env_prefix"; pub const ENVIRONMENTS_DIR: &str = "envs"; pub const SOLVE_GROUP_ENVIRONMENTS_DIR: &str = "solve-group-envs"; diff --git a/docs/advanced/github_actions.md b/docs/advanced/github_actions.md index 78436ba45..1366b695d 100644 --- a/docs/advanced/github_actions.md +++ b/docs/advanced/github_actions.md @@ -15,7 +15,7 @@ We created [prefix-dev/setup-pixi](https://github.com/prefix-dev/setup-pixi) to ```yaml - uses: prefix-dev/setup-pixi@v0.8.0 with: - pixi-version: v0.29.0 + pixi-version: v0.30.0 cache: true auth-host: prefix.dev auth-token: ${{ secrets.PREFIX_DEV_TOKEN }} diff --git a/install/install.ps1 b/install/install.ps1 index 13ae92e7a..ae92b6ecb 100644 --- a/install/install.ps1 +++ b/install/install.ps1 @@ -18,7 +18,7 @@ .LINK https://github.com/prefix-dev/pixi .NOTES - Version: v0.29.0 + Version: v0.30.0 #> param ( [string] $PixiVersion = 'latest', diff --git a/install/install.sh b/install/install.sh index 71657ac4e..c0e6545fd 100644 --- a/install/install.sh +++ b/install/install.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash set -euo pipefail -# Version: v0.29.0 +# Version: v0.30.0 __wrap__() { diff --git a/schema/schema.json b/schema/schema.json index a2a259959..b56db2759 100644 --- a/schema/schema.json +++ b/schema/schema.json @@ -1,6 +1,6 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://pixi.sh/v0.29.0/schema/manifest/schema.json", + "$id": "https://pixi.sh/v0.30.0/schema/manifest/schema.json", "title": "`pixi.toml` manifest file", "description": "The configuration for a [`pixi`](https://pixi.sh) project.", "type": "object", @@ -13,7 +13,7 @@ "title": "Schema", "description": "The schema identifier for the project's configuration", "type": "string", - "default": "https://pixi.sh/v0.29.0/schema/manifest/schema.json", + "default": "https://pixi.sh/v0.30.0/schema/manifest/schema.json", "format": "uri-reference" }, "activation": { diff --git a/scripts/release.py b/scripts/release.py index 4e345095e..bc04f1a2c 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -2,15 +2,33 @@ import re import os from pathlib import Path +import atexit + +COLORS = {"yellow": "\033[93m", "magenta": "\033[95m", "reset": "\033[0m"} + +status = [] + + +def colored_print(message: str, color: str): + color_code = COLORS.get(color, None) + if color_code: + print(f"{color_code}{message}{COLORS['reset']}") + else: + print(message) + + +def colored_input(prompt: str, color: str) -> str: + color_code = COLORS.get(color, COLORS["reset"]) + return input(f"{color_code}{prompt}{COLORS['reset']}") def run_command(command: list[str], capture_stdout=False) -> str | None: - print(f"Running command: {' '.join([str(c) for c in command])}") + colored_print(f"Running command: {' '.join([str(c) for c in command])}", "yellow") result = subprocess.run( command, stdout=subprocess.PIPE if capture_stdout else None, stderr=None, text=True ) if result.returncode != 0: - print(f"Error running command: {' '.join(command)}") + colored_print(f"Error running command: {' '.join(map(str, command))}", "yellow") exit(result.returncode) if capture_stdout: return result.stdout.strip() @@ -19,13 +37,26 @@ def run_command(command: list[str], capture_stdout=False) -> str | None: def get_release_version(): pattern = re.compile(r"^\d+\.\d+\.\d+$") + version_from_env = os.environ.get("RELEASE_VERSION") + + if version_from_env and pattern.match(version_from_env): + default_version = version_from_env + else: + default_version = "" + while True: - release_version = input("Enter the release version (X.Y.Z): ") + prompt = ( + f"Enter the release version (X.Y.Z) [{default_version}]: " + if default_version + else "Enter the release version (X.Y.Z): " + ) + release_version = colored_input(prompt, "magenta") or default_version if pattern.match(release_version): return release_version else: - print( - "Invalid format. Please enter the version in the format X.Y.Z where X, Y, and Z are integers." + colored_print( + "Invalid format. Please enter the version in the format X.Y.Z where X, Y, and Z are integers.", + "yellow", ) @@ -38,77 +69,172 @@ def get_pixi() -> Path: raise ValueError(f"The path {pixi_bin} doesn't exist.") -def main(): - print("Making a release of pixi") - pixi = get_pixi() - - # Prep - input("Make sure main is up-to-date and CI passes. Press Enter to continue...") - - release_version = get_release_version() - os.environ["RELEASE_VERSION"] = release_version - - print("\nCreating a new branch for the release...") - run_command(["git", "checkout", "main"]) - run_command(["git", "pull", "upstream", "main"]) - branch = f"bump/prepare-v{release_version}" - - branch_exists = run_command(["git", "branch", "--list", branch], capture_stdout=True) - if branch_exists: - run_command(["git", "branch", "--delete", branch]) - run_command(["git", "switch", "--create", branch]) - - print("\nBumping all versions...") - run_command([pixi, "run", "bump"]) +def print_summary(): + colored_print("\nSummary of completed steps:", "yellow") + for step in status: + colored_print(f"- {step}", "yellow") - print("\nUpdating the changelog...") - run_command([pixi, "run", "bump-changelog"]) - input( - "Don't forget to update the 'Highlights' section in `CHANGELOG.md`. Press Enter to continue..." - ) - - print("\nCommitting the changes...") - run_command(["git", "commit", "-am", f"chore: version to {release_version}"]) - - print("\nPushing the changes...") - run_command(["git", "push", "origin"]) - - # Release prep PR - print("\nRelease prep PR") - input("Create a PR to check off the change with the peers. Press Enter to continue...") - input("Merge that PR. Press Enter to continue...") - - # Tagging the release - print("\nTagging the release") - print("\nChecking out main...") - run_command(["git", "fetch", "upstream"]) - run_command(["git", "checkout", "upstream/main"]) - print("\nTagging the release...") - run_command(["git", "tag", f"v{release_version}", "-m", f"Release {release_version}"]) +atexit.register(print_summary) - print("\nPushing the tag...") - run_command(["git", "push", "upstream", f"v{release_version}"]) - # Publishing the release - input( - "Update the Release which has CI created for you (after the first build) and add the changelog to the release notes. Press Enter to continue..." - ) - input("Make sure all the artifacts are there and the CI is green!!! Press Enter to continue...") - input("Publish the release and make sure it is set as latest. Press Enter to continue...") - - # Test the release using the install script - print("Testing the release using `pixi self-update`...") - run_command([pixi, "self-update"]) +def main(): + steps = [ + "Start release process", + "Check main branch and CI status", + "Set release version", + "Create and switch to release branch", + "Bump all versions", + "Update changelog", + "Lint changes", + "Commit changes", + "Push changes", + "Create and merge release prep PR", + "Tag release", + "Push tag", + "Publish release", + "Test release", + ] + + colored_print("Select the step to start from:", "yellow") + for i, step in enumerate(steps, 1): + colored_print(f"{i}. {step}", "yellow") - version_output = run_command([pixi, "--version"], capture_stdout=True) - expected_version_output = f"pixi {release_version}" - if version_output == expected_version_output: - print(f"Version check passed: {version_output}") - else: - print(f"Version check failed: expected {expected_version_output}, got {version_output}") + while True: + try: + start_step = int(colored_input("Enter the step number: ", "magenta")) + if 1 <= start_step <= len(steps): + break + else: + colored_print("Invalid step number. Please enter a valid number.", "yellow") + except ValueError: + colored_print("Invalid input. Please enter a number.", "yellow") - print("\nDONE!") + pixi = get_pixi() + try: + if start_step <= 1: + colored_print("Making a release of pixi", "yellow") + status.append("Started release process") + + if start_step <= 2: + colored_input( + "Make sure main is up-to-date and CI passes. Press Enter to continue...", "magenta" + ) + status.append("Checked main branch and CI status") + + if start_step <= 3: + release_version = get_release_version() + os.environ["RELEASE_VERSION"] = release_version + status.append(f"Release version set to {release_version}") + + if start_step <= 4: + colored_print("\nCreating a new branch for the release...", "yellow") + run_command(["git", "checkout", "main"]) + run_command(["git", "pull", "upstream", "main"]) + branch = f"bump/prepare-v{release_version}" + + branch_exists = run_command(["git", "branch", "--list", branch], capture_stdout=True) + if branch_exists: + run_command(["git", "branch", "--delete", branch]) + run_command(["git", "switch", "--create", branch]) + status.append(f"Created and switched to branch {branch}") + + if start_step <= 5: + colored_print("\nBumping all versions...", "yellow") + run_command([pixi, "run", "bump"]) + status.append("Bumped all versions") + + if start_step <= 6: + while True: + response = ( + colored_input("Should we bump the changelog? (yes/no): ", "magenta") + .strip() + .lower() + ) + if response.lower() in ["yes", "no", "y", "n"]: + break + else: + colored_print("Invalid response. Please enter 'yes' or 'no'.", "yellow") + if response == "yes" or response == "y": + run_command([pixi, "run", "bump-changelog"]) + colored_input( + "Don't forget to update the 'Highlights' section in `CHANGELOG.md`. Press Enter to continue...", + "magenta", + ) + status.append("Updated the changelog") + + if start_step <= 7: + colored_print("\nLinting the changes...", "yellow") + run_command([pixi, "run", "lint"]) + + if start_step <= 8: + colored_print("\nCommitting the changes...", "yellow") + run_command(["git", "commit", "-am", f"chore: version to {release_version}"]) + status.append("Committed the changes") + + if start_step <= 9: + colored_print("\nPushing the changes...", "yellow") + run_command(["git", "push", "origin"]) + status.append("Pushed the changes") + + if start_step <= 10: + colored_print("\nRelease prep PR", "yellow") + colored_input( + "Create a PR to check off the change with the peers. Press Enter to continue...", + "magenta", + ) + colored_input("Merge that PR. Press Enter to continue...", "magenta") + status.append("Created and merged the release prep PR") + + if start_step <= 11: + colored_print("\nTagging the release", "yellow") + colored_print("\nChecking out main...", "yellow") + run_command(["git", "fetch", "upstream"]) + run_command(["git", "checkout", "upstream/main"]) + + colored_print("\nTagging the release...", "yellow") + run_command(["git", "tag", f"v{release_version}", "-m", f"Release {release_version}"]) + status.append(f"Tagged the release with version {release_version}") + + if start_step <= 12: + colored_print("\nPushing the tag...", "yellow") + run_command(["git", "push", "upstream", f"v{release_version}"]) + status.append("Pushed the tag") + + if start_step <= 13: + colored_input( + "Update the Release which has CI created for you (after the first build) and add the changelog to the release notes. Press Enter to continue...", + "magenta", + ) + colored_input( + "Make sure all the artifacts are there and the CI is green!!! Press Enter to continue...", + "magenta", + ) + colored_input( + "Publish the release and make sure it is set as latest. Press Enter to continue...", + "magenta", + ) + status.append("Published the release") + + colored_print("Testing the release using `pixi self-update`...", "yellow") + run_command([pixi, "self-update"]) + + version_output = run_command([pixi, "--version"], capture_stdout=True) + expected_version_output = f"pixi {release_version}" + if version_output == expected_version_output: + colored_print(f"Version check passed: {version_output}", "yellow") + else: + colored_print( + f"Version check failed: expected {expected_version_output}, got {version_output}", + "yellow", + ) + status.append("Tested the release") + + colored_print("\nDONE!", "yellow") + status.append("Release process completed successfully") + + except KeyboardInterrupt: + colored_print("\nProcess interrupted.", "yellow") if __name__ == "__main__": diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 22ef63b99..22bee012e 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -41,7 +41,7 @@ pub mod upload; #[command( version, about = " -Pixi [version 0.29.0] - Developer Workflow and Environment Management for Multi-Platform, Language-Agnostic Projects. +Pixi [version 0.30.0] - Developer Workflow and Environment Management for Multi-Platform, Language-Agnostic Projects. Pixi is a versatile developer workflow tool designed to streamline the management of your project's dependencies, tasks, and environments. Built on top of the Conda ecosystem, Pixi offers seamless integration with the PyPI ecosystem. diff --git a/tbump.toml b/tbump.toml index 70ae7e0cf..b70957ebd 100644 --- a/tbump.toml +++ b/tbump.toml @@ -1,7 +1,7 @@ github_url = "https://github.com/prefix-dev/pixi" [version] -current = "0.29.0" +current = "0.30.0" # Example of a semver regexp. # Make sure this matches current_version before @@ -19,7 +19,7 @@ regex = ''' [git] # The current version will get updated when tbump is run -message_template = "Bump version: 0.29.0 → {new_version}" +message_template = "Bump version: 0.30.0 → {new_version}" tag_template = "v{new_version}" # For each file to patch, add a [[file]] config @@ -61,7 +61,7 @@ src = "src/cli/mod.rs" [[file]] search = "PIXI_VERSION = \"{current_version}\"" -src = "tests/integration/test_main_cli.py" +src = "tests/integration/common.py" [[file]] search = "pub const PIXI_VERSION: &str = \"{current_version}\";" diff --git a/tests/integration/common.py b/tests/integration/common.py index 25448ca83..a00be3299 100644 --- a/tests/integration/common.py +++ b/tests/integration/common.py @@ -2,7 +2,7 @@ from pathlib import Path import subprocess -PIXI_VERSION = "0.29.0" +PIXI_VERSION = "0.30.0" class ExitCode(IntEnum):