From 36ab9b25d20d8dd6de28909f7a87e55c3e30ea00 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 14:05:53 +0800 Subject: [PATCH 01/12] feat: support windows --- .github/workflows/CI.yml | 34 +++++++++++++++++++--------------- Cargo.toml | 4 ++-- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 0844782..179da9a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -29,19 +29,23 @@ jobs: name: wheels path: dist - # windows: - # runs-on: windows-latest - # steps: - # - uses: actions/checkout@v3 - # - uses: messense/maturin-action@v1 - # with: - # command: build - # args: --release -o dist --find-interpreter - # - name: Upload wheels - # uses: actions/upload-artifact@v3 - # with: - # name: wheels - # path: dist + windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - name: Set up Rust + uses: dtolnay/rust-toolchain@master + with: + toolchain: nightly-2022-12-20 + - uses: messense/maturin-action@v1 + with: + command: build + args: --release -o dist --find-interpreter + - name: Upload wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: dist macos: runs-on: macos-latest @@ -52,7 +56,7 @@ jobs: - uses: messense/maturin-action@v1 with: command: build - args: --release -o dist --universal2 --find-interpreter + args: --release -o dist - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -63,7 +67,7 @@ jobs: name: Release runs-on: ubuntu-latest if: "startsWith(github.ref, 'refs/tags/')" - needs: [macos, linux] + needs: [macos, linux, windows] steps: - uses: actions/download-artifact@v3 with: diff --git a/Cargo.toml b/Cargo.toml index aa8c504..7512c1e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,5 +21,5 @@ crate-type = ["cdylib"] pyo3 = { version = "0.18.0", features = ["extension-module"] } lazy_static = "1.4.0" -# tzf-rs = { git = "http://github.com/ringsaturn/tzf-rs", rev = "8f6873966079f8c27b6816cdfe3a1652469ebd24"} -tzf-rs = "0.2.0" +tzf-rs = { git = "http://github.com/yihong0618/tzf-rs", rev = "fce8f4cd19ee05a8f0bd00aca3f2822a5f18ce2a"} +# tzf-rs = "0.2.0" From d6126c6591ac22085bc3e5c59845f7c407460bcb Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 14:07:02 +0800 Subject: [PATCH 02/12] fix: add comment --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 7512c1e..8aac296 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,5 +21,6 @@ crate-type = ["cdylib"] pyo3 = { version = "0.18.0", features = ["extension-module"] } lazy_static = "1.4.0" +# when tzf-rs PR merged and bump another change this tzf-rs = { git = "http://github.com/yihong0618/tzf-rs", rev = "fce8f4cd19ee05a8f0bd00aca3f2822a5f18ce2a"} # tzf-rs = "0.2.0" From fdf128fd0a8d6d2e8e661b1d2c30102649f1c90e Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 14:08:12 +0800 Subject: [PATCH 03/12] ci: add cache --- .github/workflows/CI.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 179da9a..2a06528 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -33,10 +33,8 @@ jobs: runs-on: windows-latest steps: - uses: actions/checkout@v3 - - name: Set up Rust - uses: dtolnay/rust-toolchain@master - with: - toolchain: nightly-2022-12-20 + - name: Cache + uses: Swatinem/rust-cache@v2 - uses: messense/maturin-action@v1 with: command: build From ab9784bd3c7e210c31a18e57a1ae3f4974bfab51 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 14:48:56 +0800 Subject: [PATCH 04/12] fix: bump tzf-rs version add test --- .github/workflows/Test.yml | 17 ++++++++++++++--- Cargo.toml | 6 +++--- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 46eac9f..9c09683 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -11,12 +11,13 @@ concurrency: cancel-in-progress: true jobs: - linux: - runs-on: ubuntu-latest + Testing: + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: python-version: ["3.9", "3.10", "3.11"] + os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v3 @@ -39,10 +40,20 @@ jobs: run: | python -m venv venv - - name: Install tzfpy and test + - name: Install tzfpy and test(not windows) + if: matrix.os != 'windows-latest' run: | source venv/bin/activate pip install --upgrade pip pip install -r requirements_dev.txt maturin develop pytest --cov + + - name: Install tzfpy and test(windows) + if: matrix.os == 'windows-latest' + run: | + . venv\Scripts\activate.bat + python -m pip install --upgrade pip + python -m pip install -r requirements_dev.txt + maturin develop + pytest --cov diff --git a/Cargo.toml b/Cargo.toml index 8aac296..6edd843 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,6 @@ crate-type = ["cdylib"] pyo3 = { version = "0.18.0", features = ["extension-module"] } lazy_static = "1.4.0" -# when tzf-rs PR merged and bump another change this -tzf-rs = { git = "http://github.com/yihong0618/tzf-rs", rev = "fce8f4cd19ee05a8f0bd00aca3f2822a5f18ce2a"} -# tzf-rs = "0.2.0" +# tzf-rs = { git = "http://github.com/ringsaturn/tzf-rs", rev = "8f6873966079f8c27b6816cdfe3a1652469ebd24"} +tzf-rs = "0.2.1" + From bdfc25f3358a8a4d89b756ff2c003ad8d4164f1a Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 15:07:55 +0800 Subject: [PATCH 05/12] Trigger CI From 4d98929bd254a6af8673e2e82288e40f95a32c92 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 15:14:03 +0800 Subject: [PATCH 06/12] fix: citiespy version --- requirements_dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_dev.txt b/requirements_dev.txt index 3edd884..b542f32 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -1,4 +1,4 @@ -citiespy==0.3.2 +citiespy==0.3.3 maturin==0.14.8 pytest pytest-benchmark From 5c9c142422ca20828431af829e545cd08ce3fe55 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 15:19:13 +0800 Subject: [PATCH 07/12] fix: maturin build on windows --- .github/workflows/Test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 9c09683..c00158f 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -50,10 +50,12 @@ jobs: pytest --cov - name: Install tzfpy and test(windows) + # for windows need maturin build if: matrix.os == 'windows-latest' run: | . venv\Scripts\activate.bat python -m pip install --upgrade pip python -m pip install -r requirements_dev.txt - maturin develop + maturin build + pip install target/wheels/citiespy-*.whl pytest --cov From 8606560f6a2d228d574fc70a75914a18f2403d4f Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 15:24:29 +0800 Subject: [PATCH 08/12] fix: typo... --- .github/workflows/CI.yml | 2 +- .github/workflows/Test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 2a06528..09ae394 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -38,7 +38,7 @@ jobs: - uses: messense/maturin-action@v1 with: command: build - args: --release -o dist --find-interpreter + args: --release -o dist --universal2 --find-interpreter - name: Upload wheels uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index c00158f..11670b7 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -57,5 +57,5 @@ jobs: python -m pip install --upgrade pip python -m pip install -r requirements_dev.txt maturin build - pip install target/wheels/citiespy-*.whl + pip install target/wheels/tzfpy-*.whl pytest --cov From 92c3e78f12c7b7acb8ca9c50d1c01e95f1d0f14b Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 15:33:19 +0800 Subject: [PATCH 09/12] fix: windows filename to bash --- .github/workflows/Test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 11670b7..a026ad6 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -50,6 +50,7 @@ jobs: pytest --cov - name: Install tzfpy and test(windows) + shell: bash # for windows need maturin build if: matrix.os == 'windows-latest' run: | From df11ef87a2e6caa38f24985e9abaf80ab47fb548 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 15:35:18 +0800 Subject: [PATCH 10/12] fix: debug --- .github/workflows/Test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index a026ad6..c277b06 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -50,7 +50,6 @@ jobs: pytest --cov - name: Install tzfpy and test(windows) - shell: bash # for windows need maturin build if: matrix.os == 'windows-latest' run: | @@ -58,5 +57,5 @@ jobs: python -m pip install --upgrade pip python -m pip install -r requirements_dev.txt maturin build - pip install target/wheels/tzfpy-*.whl + pip install target\wheels\tzfpy-*.whl pytest --cov From fbca10909a03c2420d98f4a0fbc9657e77705d0a Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 15:40:55 +0800 Subject: [PATCH 11/12] fix: debug.... --- .github/workflows/Test.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index c277b06..91982db 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -50,12 +50,13 @@ jobs: pytest --cov - name: Install tzfpy and test(windows) + shell: bash # for windows need maturin build if: matrix.os == 'windows-latest' run: | - . venv\Scripts\activate.bat + . venv/Scripts/activate.bat python -m pip install --upgrade pip python -m pip install -r requirements_dev.txt maturin build - pip install target\wheels\tzfpy-*.whl + pip install target/wheels/tzfpy-*.whl pytest --cov From 8cea752d83fc23206552fdf22acde4840f7bc9f7 Mon Sep 17 00:00:00 2001 From: yihong0618 Date: Wed, 25 Jan 2023 15:51:39 +0800 Subject: [PATCH 12/12] fix: drop venv --- .github/workflows/Test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml index 91982db..e66b468 100644 --- a/.github/workflows/Test.yml +++ b/.github/workflows/Test.yml @@ -54,7 +54,6 @@ jobs: # for windows need maturin build if: matrix.os == 'windows-latest' run: | - . venv/Scripts/activate.bat python -m pip install --upgrade pip python -m pip install -r requirements_dev.txt maturin build