From aa9264170ebb0df9c4f1ae7a2272f711549bd863 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Oct 2023 11:08:32 +0000 Subject: [PATCH 1/9] Update pyo3 requirement from 0.19.0 to 0.20.0 Updates the requirements on [pyo3](https://github.com/pyo3/pyo3) to permit the latest version. - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/main/CHANGELOG.md) - [Commits](https://github.com/pyo3/pyo3/compare/v0.19.0...v0.20.0) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 48f14e5..c4b9888 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ name = "hifitime" serde = { version = "1.0.155", optional = true } serde_derive = { version = "1.0.155", optional = true } der = { version = "0.6.1", features = ["derive", "real"], optional = true } -pyo3 = { version = "0.19.0", features = ["extension-module"], optional = true } +pyo3 = { version = "0.20.0", features = ["extension-module"], optional = true } num-traits = { version = "0.2.15", default-features = false, features = [ "libm", ] } From 3235e59e60bf151892649f70afc98f5f7fe29398 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Thu, 16 Nov 2023 18:27:27 -0700 Subject: [PATCH 2/9] Version bump --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c4b9888..03dc8be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hifitime" -version = "3.8.4" +version = "3.8.5" authors = ["Christopher Rabotin "] description = "Ultra-precise date and time handling in Rust for scientific applications with leap second support" homepage = "https://nyxspace.com/" From 3857594e7d7bb7f14f9d9feae25d491fc8908302 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Thu, 16 Nov 2023 18:41:33 -0700 Subject: [PATCH 3/9] Richcomp may be implemented by pyo3 v 0.20 --- .github/workflows/python.yml | 9 ++++++--- src/duration.rs | 12 ------------ tests/python/test_epoch.py | 13 ++++++++++++- 3 files changed, 18 insertions(+), 16 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 36570d1..ea7e6e8 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -36,6 +36,9 @@ jobs: args: --release --out dist --find-interpreter -F python sccache: 'true' manylinux: auto + before-script-linux: | + sudo apt-get update + sudo apt-get install -y libclang-dev - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -74,7 +77,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' architecture: ${{ matrix.target }} - name: Build wheels uses: PyO3/maturin-action@v1 @@ -105,7 +108,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Build wheels uses: PyO3/maturin-action@v1 with: diff --git a/src/duration.rs b/src/duration.rs index fb61825..38f7a51 100644 --- a/src/duration.rs +++ b/src/duration.rs @@ -729,18 +729,6 @@ impl Duration { *self == other } - #[cfg(feature = "python")] - fn __richcmp__(&self, other: Self, op: CompareOp) -> bool { - match op { - CompareOp::Lt => *self < other, - CompareOp::Le => *self <= other, - CompareOp::Eq => *self == other, - CompareOp::Ne => *self != other, - CompareOp::Gt => *self > other, - CompareOp::Ge => *self >= other, - } - } - // Python constructors #[cfg(feature = "python")] diff --git a/tests/python/test_epoch.py b/tests/python/test_epoch.py index 7bafd52..1e39c8f 100644 --- a/tests/python/test_epoch.py +++ b/tests/python/test_epoch.py @@ -1,4 +1,4 @@ -from hifitime import Epoch, TimeSeries, Unit +from hifitime import Epoch, TimeSeries, Unit, Duration from datetime import datetime @@ -44,3 +44,14 @@ def test_time_series(): print(f"#{num}:\t{epoch}") assert num == 10 + +def test_duration_eq(): + """ + Checks that Duration comparisons work + """ + + assert Unit.Second * 0.0 == Duration("0 ns") + assert Unit.Second * 1.0 >= Duration("0 ns") + assert Unit.Second * 1.0 > Duration("0 ns") + assert Duration("0 ns") <= Unit.Second * 1.0 + assert Duration("0 ns") < Unit.Second * 1.0 \ No newline at end of file From 3ba8fb5c8e4f5b8a36e1fb49bc14ea1e2417d29c Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 18 Nov 2023 12:30:48 -0700 Subject: [PATCH 4/9] Implement lt,le,gt,ge --- .github/workflows/python.yml | 13 +++++-------- pyproject.toml | 4 ++-- src/duration.rs | 20 ++++++++++++++++++++ 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ea7e6e8..7b2e847 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -1,4 +1,4 @@ -# This file is autogenerated by maturin v0.14.17 +# This file is autogenerated by maturin v1.3.2 # To update, run # # maturin generate-ci --pytest -o .github/workflows/python.yml github @@ -28,7 +28,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.10' - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -36,9 +36,6 @@ jobs: args: --release --out dist --find-interpreter -F python sccache: 'true' manylinux: auto - before-script-linux: | - sudo apt-get update - sudo apt-get install -y libclang-dev - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -77,7 +74,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.10' architecture: ${{ matrix.target }} - name: Build wheels uses: PyO3/maturin-action@v1 @@ -108,7 +105,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.11' + python-version: '3.10' - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -159,4 +156,4 @@ jobs: MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} with: command: upload - args: --skip-existing * + args: --non-interactive --skip-existing * diff --git a/pyproject.toml b/pyproject.toml index fd60678..1660726 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["maturin>=0.13,<0.14"] +requires = ["maturin>=1.3,<1.4"] build-backend = "maturin" [project] @@ -15,4 +15,4 @@ classifiers = [ [tool.yapf] based_on_style = "google" spaces_before_comment = 4 -column_limit = 100 \ No newline at end of file +column_limit = 100 diff --git a/src/duration.rs b/src/duration.rs index 38f7a51..43260d8 100644 --- a/src/duration.rs +++ b/src/duration.rs @@ -729,6 +729,26 @@ impl Duration { *self == other } + #[cfg(feature = "python")] + fn __le__(&self, other: Self) -> bool { + *self <= other + } + + #[cfg(feature = "python")] + fn __lt__(&self, other: Self) -> bool { + *self < other + } + + #[cfg(feature = "python")] + fn __ge__(&self, other: Self) -> bool { + *self >= other + } + + #[cfg(feature = "python")] + fn __gt__(&self, other: Self) -> bool { + *self > other + } + // Python constructors #[cfg(feature = "python")] From b18ad4b8d6bd02bd4696084ef09f0e859b9a61de Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 18 Nov 2023 12:49:06 -0700 Subject: [PATCH 5/9] Update UT1 test from JPL data --- tests/ut1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ut1.rs b/tests/ut1.rs index 2934e88..2f6a29c 100644 --- a/tests/ut1.rs +++ b/tests/ut1.rs @@ -46,6 +46,6 @@ fn test_ut1_from_jpl() { let ut1_epoch = epoch.to_ut1(provider); assert_eq!( format!("{:x}", ut1_epoch), - "2022-01-03T03:05:06.679020600 TAI", + "2022-01-03T03:05:43.789100000 TAI", ); } From 7dd7a07ef91e26d4755ba5b5ae8abfb31edcdcd5 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 18 Nov 2023 13:00:21 -0700 Subject: [PATCH 6/9] Bump MSRV --- .github/workflows/tests.yml | 2 +- README.md | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e8d4a7e..2ee7e22 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,7 +33,7 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] rust: - - { version: "1.64", name: MSRV } + - { version: "1.70", name: MSRV } - { version: stable, name: stable } runs-on: ${{ matrix.os }} diff --git a/README.md b/README.md index ea93d2c..3f57bbe 100644 --- a/README.md +++ b/README.md @@ -214,7 +214,7 @@ In Python: [![hifitime on crates.io][cratesio-image]][cratesio] [![hifitime on docs.rs][docsrs-image]][docsrs] -[![minimum rustc: 1.64](https://img.shields.io/badge/minimum%20rustc-1.64-yellowgreen?logo=rust)](https://www.whatrustisit.com) +[![minimum rustc: 1.70](https://img.shields.io/badge/minimum%20rustc-1.70-yellowgreen?logo=rust)](https://www.whatrustisit.com) [![Build Status](https://github.com/nyx-space/hifitime/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/nyx-space/hifitime/actions) [![Build Status](https://github.com/nyx-space/hifitime/actions/workflows/formal_verification.yml/badge.svg?branch=master)](https://github.com/nyx-space/hifitime/actions) [![codecov](https://codecov.io/gh/nyx-space/hifitime/branch/master/graph/badge.svg?token=l7zU57rUGs)](https://codecov.io/gh/nyx-space/hifitime) @@ -309,6 +309,12 @@ In order to provide full interoperability with NAIF, hifitime uses the NAIF algo # Changelog +## 3.8.5 + +Changes from 3.8.2 are only dependency upgrades until this release. + +Minimum Supported Rust version bumped from 1.64 to **1.70**. + ## 3.8.2 + Clarify README and add a section comparing Hifitime to `time` and `chrono`, cf. [#221](https://github.com/nyx-space/hifitime/issues/221) + Fix incorrect printing of Gregorian dates prior to to 1900, cf. [#204](https://github.com/nyx-space/hifitime/issues/204) From 4ee554db03a879cdc6a3e18e902ce2123d79bf89 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 18 Nov 2023 13:04:40 -0700 Subject: [PATCH 7/9] Disable scache --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7b2e847..30a2c2c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -34,7 +34,7 @@ jobs: with: target: ${{ matrix.target }} args: --release --out dist --find-interpreter -F python - sccache: 'true' + sccache: 'false' manylinux: auto - name: Upload wheels uses: actions/upload-artifact@v3 From 9f76174ce010f2210bf43cae17319c7e29ad75b8 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 18 Nov 2023 14:16:22 -0700 Subject: [PATCH 8/9] Disable manulinux --- .github/workflows/python.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 30a2c2c..6dd68f6 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -35,7 +35,7 @@ jobs: target: ${{ matrix.target }} args: --release --out dist --find-interpreter -F python sccache: 'false' - manylinux: auto + manylinux: false - name: Upload wheels uses: actions/upload-artifact@v3 with: From 11c524686fdd5ad6820d38c2a6bdf898b022bc82 Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sat, 18 Nov 2023 14:34:51 -0700 Subject: [PATCH 9/9] Switch build for Python --- .github/workflows/python.yml | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 6dd68f6..69d88cb 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -28,14 +28,27 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Build wheels uses: PyO3/maturin-action@v1 with: target: ${{ matrix.target }} args: --release --out dist --find-interpreter -F python - sccache: 'false' - manylinux: false + manylinux: auto + before-script-linux: | + # If we're running on rhel centos, install needed packages. + if command -v yum &> /dev/null; then + yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic + + # If we're running on i686 we need to symlink libatomic + # in order to build openssl with -latomic flag. + if [[ ! -d "/usr/lib64" ]]; then + ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so + fi + else + # If we're running on debian-based system. + apt update -y && apt-get install -y libssl-dev openssl pkg-config + fi - name: Upload wheels uses: actions/upload-artifact@v3 with: @@ -74,7 +87,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' architecture: ${{ matrix.target }} - name: Build wheels uses: PyO3/maturin-action@v1 @@ -105,7 +118,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Build wheels uses: PyO3/maturin-action@v1 with: