Skip to content

orjson is outdated (Python 3.8 compat) #7313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
benjaoming opened this issue Jul 23, 2020 · 7 comments
Closed

orjson is outdated (Python 3.8 compat) #7313

benjaoming opened this issue Jul 23, 2020 · 7 comments
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@benjaoming
Copy link
Contributor

benjaoming commented Jul 23, 2020

Details

Hi friends, working on a development setup where I was incidentally on Python 3.8. I think this could easily be fixed, as orjson doesn't seem to have any backwards-incompatible changes, apart from this:

orjson.dumps() serializes dataclasses.dataclass and uuid.UUID instances by default. The options OPT_SERIALIZE_DATACLASS and OPT_SERIALIZE_UUID can still be specified but have no effect.

  • Read the Docs project URL: n/a
  • Build URL (if applicable): n/a
  • Read the Docs username (if applicable): n/a

Expected Result

I am not able to build ReadTheDocs w/ Python 3.8 on a system w/o Rust. I assume it's because the old Wheel doesn't come with pre-compiled binaries for Py3.8. Which is fair and expectable.

This works up until Python 3.7.

By using a newer version, it's possible again to install.

It's recommended to use orjson>=3,<4, see: https://github.com/ijl/orjson + several bug fixes: https://github.com/ijl/orjson/releases

Actual Result

(readthedocs) ➜  readthedocs.org git:(4f25c132e) ~ pip install orjson==2.0.7 -i https://pypi.org/simple
Collecting orjson==2.0.7
  Downloading orjson-2.0.7.tar.gz (480 kB)
     |████████████████████████████████| 480 kB 5.2 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/.virtualenvs/readthedocs/bin/python3 /home/user/.virtualenvs/readthedocs/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp0il1_f4d
         cwd: /tmp/pip-install-yhst16n9/orjson
    Complete output (6 lines):
    
    Cargo, the Rust package manager, is not installed or is not on PATH.
    This package requires Rust and Cargo to compile extensions. Install it through
    the system's package manager or via https://rustup.rs/
    
    Checking for Rust toolchain....
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/.virtualenvs/readthedocs/bin/python3 /home/user/.virtualenvs/readthedocs/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp0il1_f4d Check the logs for full command output.
WARNING: You are using pip version 20.1; however, version 20.1.1 is available.
You should consider upgrading via the '/home/user/.virtualenvs/readthedocs/bin/python3 -m pip install --upgrade pip' command.

@humitos
Copy link
Member

humitos commented Jul 23, 2020

Thanks for the report. We are running Read the Docs with Python 3.6 currently in development and in production.

Regarding upgrading orjson, we are ignoring it right now because it was causing some issues in Travis:

# Ignoring orjson for now because it makes Travis to fail
orjson==2.0.7 # pyup: ignore

We should open a new PR installing the latest version of orjson and making all our tests to work. I think we will be happy to accept that PR and merge it into our codebase. Would you like to take a look at that?

@stsewd stsewd added the Improvement Minor improvement to code label Jul 23, 2020
@benjaoming
Copy link
Contributor Author

Thanks for the response @humitos !

Would you like to take a look at that?

Yes, will have a look! 👍

@andreasWallnerIFX
Copy link

It would be nice if the update here could be done, my installation currently breaks because of the old orjson version.
orsjon-2.0.7 requires the use of a copy of serde_json (see https://github.com/ijl/orjson/blob/2.0.7/Cargo.lock#L137 from that version) which does not exist anymore (https://github.com/ijl/json). orjson has switched to the official version von serde_json in more recent version and removed that copy.
The copy of serde_json not being available now leads to (understandable) installation errors when installing orjson version 2.0.7.
orjson did the switch with the change to version 2.6.8 (last 2.x version) should that be of any interest.

@humitos
Copy link
Member

humitos commented Sep 3, 2020

Hi! We will upgrade orjson once we migrate to Ubuntu 20.04 LTS. I opened a PR for this already at #7421 but we are not sure yet when this is going to happen.

@stale
Copy link

stale bot commented Oct 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Status: stale Issue will be considered inactive soon label Oct 22, 2020
@stsewd stsewd added Accepted Accepted issue on our roadmap and removed Status: stale Issue will be considered inactive soon labels Oct 22, 2020
@vitorinux
Copy link

This works for me (python 3.7)

requirements/pip.txt

# Ignoring orjson for now because it makes Travis to fail
#orjson==2.0.7  # pyup: ignore                          
orjson==3.0.1  # pyup: ignore

@humitos
Copy link
Member

humitos commented Mar 18, 2021

I'm closing this issue since there is nothing actionable from our side.

@humitos humitos closed this as completed Mar 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
None yet
Development

No branches or pull requests

5 participants