From 82681b21fbc097236334f4e3a401595d9b031111 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Mon, 19 Dec 2022 16:06:34 -0500 Subject: [PATCH 01/14] pin wasm wheel to 20.04 --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index f9069fb..0c552f2 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -98,7 +98,7 @@ jobs: path: dist wasm: - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 # Pyodide began supporting `micropip.install` from emscripten-compiled binary wheels # in Pyodide 0.21.0 (Aug 2022), so no need to build wheels for versions before then. # As of Nov 2022, the matrix for emscripten/python versions since then is simple. From 5256f2ba29f168a2482cead1c97ccfdc6858ed49 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Sat, 4 Feb 2023 16:12:17 -0500 Subject: [PATCH 02/14] back to working setup --- .github/workflows/wheels.yml | 51 +++++++++++++++++++++++++++++++++--- 1 file changed, 48 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0c552f2..551b80f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,6 +1,9 @@ name: Build and Release on: + push: + branches: + - build_aarch64 release: types: [published] @@ -16,7 +19,12 @@ jobs: runs-on: macos-latest strategy: matrix: - python-version: ["3.7", "3.11"] + python-version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -49,7 +57,12 @@ jobs: strategy: matrix: target: [x64, x86] - python-version: ["3.7", "3.11"] + python-version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -78,7 +91,12 @@ jobs: strategy: matrix: target: [x86_64, i686] - python-version: ["3.7", "3.11"] + python-version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' steps: - uses: actions/checkout@v2 - uses: actions/setup-python@v2 @@ -97,6 +115,33 @@ jobs: name: wheels path: dist + linux-cross: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + target: [aarch64, armv7, s390x, ppc64le] + + steps: + - uses: actions/checkout@v3 + - name: Build Wheels + uses: PyO3/maturin-action@v1 + with: + target: ${{ matrix.target }} + manylinux: auto + args: -i ${{ matrix.python-version }} --release --out dist + + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist + wasm: runs-on: ubuntu-20.04 # Pyodide began supporting `micropip.install` from emscripten-compiled binary wheels From 53ab44eecd9a1558bf77dc172ca51d0c5f3baec0 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Sat, 4 Feb 2023 16:58:12 -0500 Subject: [PATCH 03/14] remove on-push trigger used for testing --- .github/workflows/wheels.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 551b80f..0171186 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,9 +1,6 @@ name: Build and Release on: - push: - branches: - - build_aarch64 release: types: [published] From a5bcfbd7b90ba3f881ed5ad1c7081bc88527500d Mon Sep 17 00:00:00 2001 From: David Brochart Date: Mon, 6 Feb 2023 10:01:54 +0100 Subject: [PATCH 04/14] Use micromamba GitHub Action (#116) --- .github/workflows/test.yml | 12 ++++++------ environment-dev.yml | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) create mode 100644 environment-dev.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3f878df..13c4e0d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,14 +22,14 @@ jobs: shell: bash -l {0} steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v3 - - name: Install Python - uses: conda-incubator/setup-miniconda@v2 + - name: Install micromamba + uses: mamba-org/provision-with-micromamba@main with: - mamba-version: "*" - channels: conda-forge - python-version: ${{ matrix.python-version }} + environment-file: environment-dev.yml + environment-name: ypy + extra-specs: python=${{ matrix.python-version }} - name: Install Rust uses: actions-rs/toolchain@v1 diff --git a/environment-dev.yml b/environment-dev.yml new file mode 100644 index 0000000..6418c3a --- /dev/null +++ b/environment-dev.yml @@ -0,0 +1,5 @@ +name: ypy +channels: + - conda-forge +dependencies: + - pip From 93bb3630ab44a54052fa02e587802a1c09d481c7 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Sat, 4 Feb 2023 16:12:17 -0500 Subject: [PATCH 05/14] back to working setup --- .github/workflows/wheels.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0171186..551b80f 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,6 +1,9 @@ name: Build and Release on: + push: + branches: + - build_aarch64 release: types: [published] From 6f0d67e545c0b0fd64371a54f8458c241c52a18d Mon Sep 17 00:00:00 2001 From: Kafonek Date: Sat, 4 Feb 2023 16:58:12 -0500 Subject: [PATCH 06/14] remove on-push trigger used for testing --- .github/workflows/wheels.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 551b80f..0171186 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,9 +1,6 @@ name: Build and Release on: - push: - branches: - - build_aarch64 release: types: [published] From 49be6c87313652c7aafd0c588e534934ca9859b4 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Mon, 6 Feb 2023 08:48:32 -0500 Subject: [PATCH 07/14] use matrix.target in linux build --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 0171186..adaf838 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -99,7 +99,7 @@ jobs: - uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - architecture: x64 + architecture: ${{ matrix.target }} - name: Build wheels uses: messense/maturin-action@v1 with: From 245da3c1c1cfdead1c908c8d6fc70766bce0ade5 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Mon, 13 Feb 2023 19:01:18 -0500 Subject: [PATCH 08/14] bump maturin build version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index bf9b0e1..6c3e89f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=0.13,<0.14"] +requires = ["maturin>=0.14,<0.15"] build-backend = "maturin" [project] From 0956f14860052a1382a582bdfe0ac57f68a9a784 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Mon, 13 Feb 2023 19:02:08 -0500 Subject: [PATCH 09/14] basically copy py-dissimilar CI --- .github/workflows/wheels.yml | 156 +++++++++++++++++++---------------- 1 file changed, 84 insertions(+), 72 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index adaf838..fba7222 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,8 +1,12 @@ name: Build and Release on: + push: + branches: + - build_aarch64 release: types: [published] + pull_request: concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -14,35 +18,31 @@ env: jobs: macos: runs-on: macos-latest - strategy: - matrix: - python-version: - - '3.7' - - '3.8' - - '3.9' - - '3.10' - - '3.11' steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} + python-version: '3.11' architecture: x64 - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - default: true + - uses: dtolnay/rust-toolchain@stable - name: Build wheels - x86_64 - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 with: target: x86_64 - args: --release --out dist --sdist --find-interpreter + args: --release --out dist --sdist -i 3.7 3.8 3.9 3.10 3.11 pypy3.8 pypy3.9 + - name: Test built wheel - x86_64 + run: | + pip install y-py --no-index --find-links dist --force-reinstall + pip install pytest + pytest - name: Build wheels - universal2 - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 with: - args: --release --universal2 --out dist --find-interpreter + args: --release --universal2 --out dist -i 3.8 3.9 3.10 3.11 pypy3.8 pypy3.9 + - name: Test built wheel - universal2 + run: | + pip install y-py --no-index --find-links dist --force-reinstall + pytest - name: Upload wheels uses: actions/upload-artifact@v2 with: @@ -51,32 +51,31 @@ jobs: windows: runs-on: windows-latest + name: windows (${{ matrix.platform.target }}) strategy: matrix: - target: [x64, x86] - python-version: - - '3.7' - - '3.8' - - '3.9' - - '3.10' - - '3.11' + platform: + - target: x64 + interpreter: 3.7 3.8 3.9 3.10 3.11 + - target: x86 + interpreter: 3.7 3.8 3.9 3.10 3.11 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.target }} - - name: Install Rust toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - profile: minimal - default: true + python-version: '3.11' + architecture: ${{ matrix.platform.target }} + - uses: dtolnay/rust-toolchain@stable - name: Build wheels - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 with: - target: ${{ matrix.target }} - args: --release --out dist --find-interpreter + target: ${{ matrix.platform.target }} + args: --release --out dist -i ${{ matrix.platform.interpreter }} + - name: Test built wheel + run: | + pip install y-py --no-index --find-links dist --force-reinstall + pip install pytest + pytest - name: Upload wheels uses: actions/upload-artifact@v2 with: @@ -88,24 +87,25 @@ jobs: strategy: matrix: target: [x86_64, i686] - python-version: - - '3.7' - - '3.8' - - '3.9' - - '3.10' - - '3.11' steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.target }} + python-version: '3.11' + architecture: x64 - name: Build wheels - uses: messense/maturin-action@v1 + uses: PyO3/maturin-action@v1 with: + rust-toolchain: stable target: ${{ matrix.target }} manylinux: auto - args: --release --out dist --find-interpreter + args: --release --out dist -i 3.7 3.8 3.9 3.10 3.11 pypy3.8 pypy3.9 + - name: Test built wheel + if: matrix.target == 'x86_64' + run: | + pip install y-py --no-index --find-links dist --force-reinstall + pip install pytest + pytest - name: Upload wheels uses: actions/upload-artifact@v2 with: @@ -116,28 +116,40 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: - - '3.7' - - '3.8' - - '3.9' - - '3.10' - - '3.11' target: [aarch64, armv7, s390x, ppc64le] - steps: - - uses: actions/checkout@v3 - - name: Build Wheels - uses: PyO3/maturin-action@v1 - with: - target: ${{ matrix.target }} - manylinux: auto - args: -i ${{ matrix.python-version }} --release --out dist + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: Build wheels + uses: PyO3/maturin-action@v1 + with: + rust-toolchain: stable + target: ${{ matrix.target }} + manylinux: auto + args: --release --out dist -i 3.7 3.8 3.9 3.10 3.11 pypy3.8 pypy3.9 + + - uses: uraimo/run-on-arch-action@v2.3.0 + if: matrix.target != 'ppc64' + name: Test built wheel + with: + arch: ${{ matrix.target }} + distro: ubuntu20.04 + githubToken: ${{ github.token }} + install: | + apt-get update + apt-get install -y --no-install-recommends python3 python3-pip + pip3 install -U pip pytest + run: | + pip3 install y-py --no-index --find-links dist/ --force-reinstall + pytest - - name: Upload wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist wasm: runs-on: ubuntu-20.04 From 7198c0ede1579f6878058d1c8f93efde9b03d144 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Mon, 13 Feb 2023 19:02:24 -0500 Subject: [PATCH 10/14] test build --- .github/workflows/wheels.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index fba7222..8ead878 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -3,7 +3,7 @@ name: Build and Release on: push: branches: - - build_aarch64 + - build_aarch64_take_2 release: types: [published] pull_request: From 1948d13949841213ae90aa33e9b3b3e473fcbdf8 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Mon, 13 Feb 2023 19:20:59 -0500 Subject: [PATCH 11/14] remove test on push to branch --- .github/workflows/wheels.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 8ead878..96699f9 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -1,9 +1,6 @@ name: Build and Release on: - push: - branches: - - build_aarch64_take_2 release: types: [published] pull_request: From 1bf29c3dd06e02f3fae8b0f12e50a71faf70b279 Mon Sep 17 00:00:00 2001 From: Kafonek Date: Tue, 14 Feb 2023 08:54:54 -0500 Subject: [PATCH 12/14] make pypi-release wait on linux-cross job --- .github/workflows/wheels.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 96699f9..e0f56be 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -198,6 +198,7 @@ jobs: - macos - windows - linux + - linux-cross if: startsWith(github.ref, 'refs/tags/') steps: - uses: actions/download-artifact@v2 From 4c54d029801e189a90e730bd4eac072508132acf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Mon, 20 Feb 2023 09:55:09 +0100 Subject: [PATCH 13/14] Fix urls and add pkg metadata (#123) --- pyproject.toml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6c3e89f..b87674f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,17 +6,37 @@ build-backend = "maturin" name = "y-py" version = "0.5.5" description = "Python bindings for the Y-CRDT built from yrs (Rust)" +license = { file = "LICENSE" } authors = [ { name = "John Waidhofer", email = "waidhoferj@gmail.com" }, { name = "Kevin Jahns", email = "kevin.jahns@protonmail.com" }, { name = "Pierre-Olivier Simonard", email = "pierre.olivier.simonard@gmail.com" } ] readme = "README.md" -homepage = "https://github.com/y-crdt/ypy" -repository = "https://github.com/y-crdt/ypy" +keywords = [ + "crdt", +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Programming Language :: Python", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Rust", +] + +[project.urls] +Homepage = "https://github.com/y-crdt/ypy" +Source = "https://github.com/y-crdt/ypy" +Issues = "https://github.com/y-crdt/ypy/issues" +Pypi = "https://pypi.org/project/y-py" [tool.hatch.envs.test] dependencies = ["pytest", "maturin"] [[tool.hatch.envs.test.matrix]] -python = ["37", "38", "39", "310", "311"] \ No newline at end of file +python = ["37", "38", "39", "310", "311"] From 1fd29c2386d9ec090705b361d88a50e0d35b5fa0 Mon Sep 17 00:00:00 2001 From: David Brochart Date: Tue, 21 Feb 2023 10:35:21 +0100 Subject: [PATCH 14/14] Bump version 0.5.9 --- Cargo.toml | 2 +- pyproject.toml | 1 - src/lib.rs | 2 ++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f123244..5326ab3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "y-py" -version = "0.5.5" +version = "0.5.9" rust-version = "1.58" edition = "2018" diff --git a/pyproject.toml b/pyproject.toml index b87674f..7d9b3db 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,6 @@ build-backend = "maturin" [project] name = "y-py" -version = "0.5.5" description = "Python bindings for the Y-CRDT built from yrs (Rust)" license = { file = "LICENSE" } authors = [ diff --git a/src/lib.rs b/src/lib.rs index 296c8d4..377db59 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,6 +13,8 @@ use crate::y_doc::*; /// Python bindings for Y.rs #[pymodule] pub fn y_py(_py: Python, m: &PyModule) -> PyResult<()> { + m.add("__version__", env!("CARGO_PKG_VERSION"))?; + // Data Types m.add_class::()?; m.add_class::()?;