Skip to content

Add support for Python v3.13

Issues

     Compiling _pendulum v3.0.0 (/tmp/tmp64dw2s57/pendulum-3.0.0/rust)
  error[E0658]: `let...else` statements are unstable
     --> src/parsing.rs:817:9
      |
  817 | /         let Some(mut value) = self.current.to_digit(10) else {
  818 | |             return Err(self.parse_error("Invalid number in duration".to_string()));
  819 | |         };
      | |__________^
      |
      = note: see issue #87335 <https://github.com/rust-lang/rust/issues/87335> for more information
  
  For more information about this error, try `rustc --explain E0658`.
  error: could not compile `_pendulum` due to previous error
  💥 maturin failed
    Caused by: Failed to build a native library through cargo
    Caused by: Cargo build finished with "exit status: 101": `env -u CARGO PYO3_ENVIRONMENT_SIGNATURE="cpython-3.13-64bit" PYO3_PYTHON="/tmp/tmpqoyhqkti/.venv/bin/python" PYTHON_SYS_EXECUTABLE="/tmp/tmpqoyhqkti/.venv/bin/python" "cargo" "rustc" "--message-format" "json-render-diagnostics" "--manifest-path" "/tmp/tmp64dw2s57/pendulum-3.0.0/rust/Cargo.toml" "--release" "--lib"`
  Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/tmp/tmpqoyhqkti/.venv/bin/python', '--compatibility', 'off'] returned non-zero exit status 1

Python pre-releases

  • Set up v3.13 test job
    • With allow_failure: true, to allow tests to fail

Python stable release

Exception ignored in: <http.client.HTTPResponse object at 0x7f8ddda7f250>
Traceback (most recent call last):
  File "/usr/lib64/python3.13/http/client.py", line 432, in close
    super().close() # set "closed" flag
  File "/usr/lib64/python3.13/http/client.py", line 445, in flush
    self.fp.flush()
ValueError: I/O operation on closed file.
  • Remove allow_failure: true, now on the tests should pass
  • Switch Silkaj images builds to v3.13: once Pendulum provides 3.13 wheels, and rust toolchain is removed: Make poetry image standalone (#493)

CI default image switch approach change

  • Move coverage to v3.13 job
  • Set default container used by jobs to v3.13

Changing approach: keeping default image on 3.12 for pre-commit jobs, all tests and coverage generation. I think that’s ok, to keep them on to-be EOL Python version. Advantages: No need to synchronise git and pre-commit package install/uninstall among Silkaj, DuniterPy, and docker/python3/poetry#10 (closed) repositories. Also, solves the issue about still maintaining DuniterPy, which is uncertain. Less efforts spent on this topic, more onto Silkaj development. Once Py3.12 reaches EOL in Oct 2028 or before, move default version to latest stable Python version image.

Post

References

Edited by Moul
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information