Skip to content

Commit b731275

Browse files
Merge pull request #259 from nyx-space/dependabot/cargo/pyo3-0.20.0
Update pyo3 requirement from 0.19.0 to 0.20.0
2 parents b58ed96 + 11c5246 commit b731275

8 files changed

Lines changed: 61 additions & 23 deletions

File tree

.github/workflows/python.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This file is autogenerated by maturin v0.14.17
1+
# This file is autogenerated by maturin v1.3.2
22
# To update, run
33
#
44
# maturin generate-ci --pytest -o .github/workflows/python.yml github
@@ -28,14 +28,27 @@ jobs:
2828
- uses: actions/checkout@v3
2929
- uses: actions/setup-python@v4
3030
with:
31-
python-version: '3.10'
31+
python-version: '3.11'
3232
- name: Build wheels
3333
uses: PyO3/maturin-action@v1
3434
with:
3535
target: ${{ matrix.target }}
3636
args: --release --out dist --find-interpreter -F python
37-
sccache: 'true'
3837
manylinux: auto
38+
before-script-linux: |
39+
# If we're running on rhel centos, install needed packages.
40+
if command -v yum &> /dev/null; then
41+
yum update -y && yum install -y perl-core openssl openssl-devel pkgconfig libatomic
42+
43+
# If we're running on i686 we need to symlink libatomic
44+
# in order to build openssl with -latomic flag.
45+
if [[ ! -d "/usr/lib64" ]]; then
46+
ln -s /usr/lib/libatomic.so.1 /usr/lib/libatomic.so
47+
fi
48+
else
49+
# If we're running on debian-based system.
50+
apt update -y && apt-get install -y libssl-dev openssl pkg-config
51+
fi
3952
- name: Upload wheels
4053
uses: actions/upload-artifact@v3
4154
with:
@@ -74,7 +87,7 @@ jobs:
7487
- uses: actions/checkout@v3
7588
- uses: actions/setup-python@v4
7689
with:
77-
python-version: '3.10'
90+
python-version: '3.11'
7891
architecture: ${{ matrix.target }}
7992
- name: Build wheels
8093
uses: PyO3/maturin-action@v1
@@ -105,7 +118,7 @@ jobs:
105118
- uses: actions/checkout@v3
106119
- uses: actions/setup-python@v4
107120
with:
108-
python-version: '3.10'
121+
python-version: '3.11'
109122
- name: Build wheels
110123
uses: PyO3/maturin-action@v1
111124
with:
@@ -156,4 +169,4 @@ jobs:
156169
MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
157170
with:
158171
command: upload
159-
args: --skip-existing *
172+
args: --non-interactive --skip-existing *

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
matrix:
3434
os: [ubuntu-latest, macos-latest, windows-latest]
3535
rust:
36-
- { version: "1.64", name: MSRV }
36+
- { version: "1.70", name: MSRV }
3737
- { version: stable, name: stable }
3838

3939
runs-on: ${{ matrix.os }}

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "hifitime"
3-
version = "3.8.4"
3+
version = "3.8.5"
44
authors = ["Christopher Rabotin <christopher.rabotin@gmail.com>"]
55
description = "Ultra-precise date and time handling in Rust for scientific applications with leap second support"
66
homepage = "https://nyxspace.com/"
@@ -21,7 +21,7 @@ name = "hifitime"
2121
serde = { version = "1.0.155", optional = true }
2222
serde_derive = { version = "1.0.155", optional = true }
2323
der = { version = "0.6.1", features = ["derive", "real"], optional = true }
24-
pyo3 = { version = "0.19.0", features = ["extension-module"], optional = true }
24+
pyo3 = { version = "0.20.0", features = ["extension-module"], optional = true }
2525
num-traits = { version = "0.2.15", default-features = false, features = [
2626
"libm",
2727
] }

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ In Python:
214214

215215
[![hifitime on crates.io][cratesio-image]][cratesio]
216216
[![hifitime on docs.rs][docsrs-image]][docsrs]
217-
[![minimum rustc: 1.64](https://img.shields.io/badge/minimum%20rustc-1.64-yellowgreen?logo=rust)](https://www.whatrustisit.com)
217+
[![minimum rustc: 1.70](https://img.shields.io/badge/minimum%20rustc-1.70-yellowgreen?logo=rust)](https://www.whatrustisit.com)
218218
[![Build Status](https://github.com/nyx-space/hifitime/actions/workflows/tests.yml/badge.svg?branch=master)](https://github.com/nyx-space/hifitime/actions)
219219
[![Build Status](https://github.com/nyx-space/hifitime/actions/workflows/formal_verification.yml/badge.svg?branch=master)](https://github.com/nyx-space/hifitime/actions)
220220
[![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
309309

310310
# Changelog
311311

312+
## 3.8.5
313+
314+
Changes from 3.8.2 are only dependency upgrades until this release.
315+
316+
Minimum Supported Rust version bumped from 1.64 to **1.70**.
317+
312318
## 3.8.2
313319
+ Clarify README and add a section comparing Hifitime to `time` and `chrono`, cf. [#221](https://github.com/nyx-space/hifitime/issues/221)
314320
+ Fix incorrect printing of Gregorian dates prior to to 1900, cf. [#204](https://github.com/nyx-space/hifitime/issues/204)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["maturin>=0.13,<0.14"]
2+
requires = ["maturin>=1.3,<1.4"]
33
build-backend = "maturin"
44

55
[project]
@@ -15,4 +15,4 @@ classifiers = [
1515
[tool.yapf]
1616
based_on_style = "google"
1717
spaces_before_comment = 4
18-
column_limit = 100
18+
column_limit = 100

src/duration.rs

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -730,15 +730,23 @@ impl Duration {
730730
}
731731

732732
#[cfg(feature = "python")]
733-
fn __richcmp__(&self, other: Self, op: CompareOp) -> bool {
734-
match op {
735-
CompareOp::Lt => *self < other,
736-
CompareOp::Le => *self <= other,
737-
CompareOp::Eq => *self == other,
738-
CompareOp::Ne => *self != other,
739-
CompareOp::Gt => *self > other,
740-
CompareOp::Ge => *self >= other,
741-
}
733+
fn __le__(&self, other: Self) -> bool {
734+
*self <= other
735+
}
736+
737+
#[cfg(feature = "python")]
738+
fn __lt__(&self, other: Self) -> bool {
739+
*self < other
740+
}
741+
742+
#[cfg(feature = "python")]
743+
fn __ge__(&self, other: Self) -> bool {
744+
*self >= other
745+
}
746+
747+
#[cfg(feature = "python")]
748+
fn __gt__(&self, other: Self) -> bool {
749+
*self > other
742750
}
743751

744752
// Python constructors

tests/python/test_epoch.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from hifitime import Epoch, TimeSeries, Unit
1+
from hifitime import Epoch, TimeSeries, Unit, Duration
22
from datetime import datetime
33

44

@@ -44,3 +44,14 @@ def test_time_series():
4444
print(f"#{num}:\t{epoch}")
4545

4646
assert num == 10
47+
48+
def test_duration_eq():
49+
"""
50+
Checks that Duration comparisons work
51+
"""
52+
53+
assert Unit.Second * 0.0 == Duration("0 ns")
54+
assert Unit.Second * 1.0 >= Duration("0 ns")
55+
assert Unit.Second * 1.0 > Duration("0 ns")
56+
assert Duration("0 ns") <= Unit.Second * 1.0
57+
assert Duration("0 ns") < Unit.Second * 1.0

tests/ut1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ fn test_ut1_from_jpl() {
4646
let ut1_epoch = epoch.to_ut1(provider);
4747
assert_eq!(
4848
format!("{:x}", ut1_epoch),
49-
"2022-01-03T03:05:06.679020600 TAI",
49+
"2022-01-03T03:05:43.789100000 TAI",
5050
);
5151
}

0 commit comments

Comments
 (0)