diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index 578829a67b..eb543ec416 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -19,12 +19,12 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: - python-version: 3.x + python-version: '3.11' cache: pip - name: Install jq run: sudo apt-get update && sudo apt-get install -y jq - name: Install cibuildwheel - run: pip install cibuildwheel + run: pip install 'cibuildwheel>=3.0' - name: Find build identifiers using cibuildwheel --print-build-identifiers id: all-build-identifiers run: | @@ -65,6 +65,11 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install native dependencies (Ubuntu) + run: sudo apt-get update && sudo apt-get install -y libgpgme-dev libgpg-error-dev + if: "matrix.os == 'ubuntu-latest'" - name: set up rust if: matrix.os != 'ubuntu' uses: actions-rs/toolchain@v1 @@ -78,7 +83,14 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install setuptools wheel cibuildwheel + pip install setuptools wheel 'cibuildwheel>=3.0' + - name: Provide gpgme-config and gpg-error-config + if: "matrix.os == 'ubuntu-latest'" + run: | + mkdir -p "$HOME/.local/bin" + cp .github/gpgme-config "$HOME/.local/bin/gpgme-config" + cp .github/gpg-error-config "$HOME/.local/bin/gpg-error-config" + echo "$HOME/.local/bin" >> $GITHUB_PATH - name: Install gpg on supported platforms run: pip install -U gpg if: "matrix.os == 'macos-latest'" @@ -88,7 +100,7 @@ jobs: - name: Build wheels run: python -m cibuildwheel --output-dir wheelhouse env: - CIBW_SKIP: "*cp314* *musllinux* *-win32" + CIBW_SKIP: "*musllinux* *-win32" CIBW_ARCHS_MACOS: x86_64 arm64 universal2 CIBW_SKIP_LINUX: '*-musllinux_*' CIBW_ENVIRONMENT: 'PATH="$HOME/.cargo/bin:$PATH" PYO3_USE_ABI3_FORWARD_COMPATIBILITY="1"' diff --git a/Cargo.lock b/Cargo.lock index 63489435fd..4f23311368 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1071,9 +1071,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a" +checksum = "7ba0117f4212101ee6544044dae45abe1083d30ce7b29c4b5cbdfa2354e07383" dependencies = [ "chrono", "indoc", @@ -1089,19 +1089,18 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598" +checksum = "4fc6ddaf24947d12a9aa31ac65431fb1b851b8f4365426e182901eabfb87df5f" dependencies = [ - "once_cell", "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c" +checksum = "025474d3928738efb38ac36d4744a74a400c901c7596199e20e45d98eb194105" dependencies = [ "libc", "pyo3-build-config", @@ -1109,18 +1108,18 @@ dependencies = [ [[package]] name = "pyo3-filelike" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e09e283dc7f80e7deb37d06829a3e0e9e12ea4105f10388ebdd6178021567b62" +checksum = "57429f455b9811f2a8af73d8bae91e028fbf6f62ad4011073c2248bb028a2288" dependencies = [ "pyo3", ] [[package]] name = "pyo3-macros" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50" +checksum = "2e64eb489f22fe1c95911b77c44cc41e7c19f3082fc81cce90f657cdc42ffded" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -1130,9 +1129,9 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc" +checksum = "100246c0ecf400b475341b8455a9213344569af29a3c841d29270e53102e0fcf" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 716f484b6f..c7ae91e8b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -55,7 +55,7 @@ nix = { workspace = true, features = ["fs"] } [workspace.dependencies] nix = ">=0.26" -pyo3 = "=0.25" +pyo3 = "=0.26" pyo3-filelike = "0.5.0" chrono = { version = "0.4", default-features = false, features = ["std", "clock"] } url = "2" diff --git a/breezy/git/object_store.py b/breezy/git/object_store.py index 92d434dc22..b2cdcca0f0 100644 --- a/breezy/git/object_store.py +++ b/breezy/git/object_store.py @@ -899,13 +899,19 @@ def __getitem__(self, sha): raise KeyError(sha) def generate_lossy_pack_data( - self, have, want, shallow=None, progress=None, get_tagged=None, ofs_delta=False + self, + haves, + wants, + shallow=None, + progress=None, + get_tagged=None, + ofs_delta=False, ): """Generate pack data with potential data loss. Args: - have: Object IDs already available. - want: Object IDs that are wanted. + haves: Object IDs already available. + wants: Object IDs that are wanted. shallow: Optional shallow commit list. progress: Optional progress callback. get_tagged: Optional function to get tagged objects. @@ -918,8 +924,8 @@ def generate_lossy_pack_data( # because self[oid] would reconstruct them with the wrong lossy setting objects = [] processed = set() - ret: dict[ObjectID, list] = self.lookup_git_shas(list(have) + list(want)) - for commit_sha in have: + ret: dict[ObjectID, list] = self.lookup_git_shas(list(haves) + list(wants)) + for commit_sha in haves: commit_sha = self.unpeel_map.peel_tag(commit_sha, commit_sha) try: for type, type_data in ret[commit_sha]: @@ -929,8 +935,8 @@ def generate_lossy_pack_data( except KeyError: trace.mutter("unable to find remote ref %s", commit_sha) pending = set() - for commit_sha in want: - if commit_sha in have: + for commit_sha in wants: + if commit_sha in haves: continue try: for type, type_data in ret[commit_sha]: diff --git a/breezy/plugins/fastimport/cmds.py b/breezy/plugins/fastimport/cmds.py index 355e1706e9..514a27183f 100644 --- a/breezy/plugins/fastimport/cmds.py +++ b/breezy/plugins/fastimport/cmds.py @@ -351,15 +351,15 @@ def run( if mode is None: mode = "default" params = { - "info": info, - "trees": trees, - "count": count, - "checkpoint": checkpoint, - "autopack": autopack, - "inv-cache": inv_cache, - "mode": mode, - "import-marks": import_marks, - "export-marks": export_marks, + b"info": info, + b"trees": trees, + b"count": count, + b"checkpoint": checkpoint, + b"autopack": autopack, + b"inv-cache": inv_cache, + b"mode": mode, + b"import-marks": import_marks, + b"export-marks": export_marks, } return _run( source, diff --git a/breezy/plugins/fastimport/processors/generic_processor.py b/breezy/plugins/fastimport/processors/generic_processor.py index 5c8f2a6ca7..7505933d3f 100644 --- a/breezy/plugins/fastimport/processors/generic_processor.py +++ b/breezy/plugins/fastimport/processors/generic_processor.py @@ -99,15 +99,15 @@ class GenericProcessor(processor.ImportProcessor): """ known_params = [ - "info", - "trees", - "count", - "checkpoint", - "autopack", - "inv-cache", - "mode", - "import-marks", - "export-marks", + b"info", + b"trees", + b"count", + b"checkpoint", + b"autopack", + b"inv-cache", + b"mode", + b"import-marks", + b"export-marks", ] def __init__( diff --git a/doc/en/release-notes/brz-3.3.txt b/doc/en/release-notes/brz-3.3.txt index 3ca724ddd9..a041dce953 100644 --- a/doc/en/release-notes/brz-3.3.txt +++ b/doc/en/release-notes/brz-3.3.txt @@ -5,18 +5,20 @@ Breezy Release Notes .. toctree:: :maxdepth: 1 -brz 3.4.0 +brz 3.3.15 ########## -:Codename: TBD -:3.4.0: Not yet released +:3.3.15: 2025-10-26 -* The ``breezy.pyutils`` module has been removed. Use ``catalogus.pyutils`` - instead. (Jelmer Vernooij) +* Add Python 3.14 support. (Jelmer Vernooij, #2121688) -* The ``Registry`` class has been removed from ``breezy.registry``. Use - ``catalogus.registry.Registry`` instead. The ``FormatRegistry`` class - remains in ``breezy.registry``. (Jelmer Vernooij) +* Migrate Rust code to modern PyO3 0.26 API to eliminate deprecation warnings. + (Jelmer Vernooij) + +brz 3.3.14 +########## + +There was no 3.3.14 release. brz 3.3.13 ########## diff --git a/doc/en/upgrade-guide/data_migration.txt b/doc/en/upgrade-guide/data_migration.txt index bc80868fc6..36784965b6 100644 --- a/doc/en/upgrade-guide/data_migration.txt +++ b/doc/en/upgrade-guide/data_migration.txt @@ -14,7 +14,7 @@ first: A complete backup gives you a safety net in case anything goes wrong. Purging obsolete branches reduces the amount of data that needs to -be migrated. See `Finding obsolete branches`_ later for some tips +be migrated. See `finding-obsolete-branches`_ later for some tips on doing this. @@ -190,7 +190,7 @@ To migrate branches in a shared repository: new directory inside the shared repository. 3. Decide which of your local branches you want to migrate. (If you - haven't already, now's a good time for `Finding obsolete branches`_ + haven't already, now's a good time for `finding-obsolete-branches`_ and purging them, after backing up first of course.) 4. To migrate each local branch of interest, there are 2 options: @@ -217,6 +217,8 @@ However, it isn't ideal if you're not ready to include all the latest revisions from trunk into that branch yet. +.. _finding-obsolete-branches: + Finding obsolete branches ------------------------- diff --git a/pyproject.toml b/pyproject.toml index 5392b4038c..502c699363 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -192,11 +192,9 @@ convention = "google" build_dir = "breezy/locale" [tool.cibuildwheel.linux] -skip = "*-musllinux_* *cp314*" +skip = "*-musllinux_*" archs = ["auto", "aarch64"] [tool.cibuildwheel.macos] -skip = "*cp314*" [tool.cibuildwheel.windows] -skip = "*cp314*" diff --git a/src/main.rs b/src/main.rs index a49c86c1ad..43a8a634c9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,29 +92,28 @@ fn posix_setup(py: Python<'_>) -> PyResult<()> { fn main() { pyo3::prepare_freethreaded_python(); - fn main(py: Python) -> PyResult> { - posix_setup(py)?; + Python::with_gil(|py| { + let result = (|| -> PyResult> { + posix_setup(py)?; - update_path(py)?; + update_path(py)?; - check_version(py)?; + check_version(py)?; - let args: Vec = std::env::args().collect(); + let args: Vec = std::env::args().collect(); - if args.contains(&String::from("--profile-imports")) { - let profile_imports = PyModule::import(py, "profile_imports")?; - profile_imports.getattr("install")?.call1(())?; - } + if args.contains(&String::from("--profile-imports")) { + let profile_imports = PyModule::import(py, "profile_imports")?; + profile_imports.getattr("install")?.call0()?; + } - let sys = PyModule::import(py, "sys")?; - sys.setattr("argv", PyList::new(py, args)?)?; + let sys = PyModule::import(py, "sys")?; + sys.setattr("argv", PyList::new(py, args)?)?; - let main = PyModule::import(py, "breezy.__main__")?; - main.getattr("main")?.call1(()) - } + let main = PyModule::import(py, "breezy.__main__")?; + main.getattr("main")?.call0() + })(); - Python::with_gil(|py| { - let result = main(py); std::process::exit(match result { Ok(_) => 0, Err(e) if e.is_instance_of::(py) => {