Skip to content
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

Docs: Readme: To Develop Locally #1000

Closed
dave42w opened this issue Oct 27, 2024 · 7 comments · Fixed by #1018
Closed

Docs: Readme: To Develop Locally #1000

dave42w opened this issue Oct 27, 2024 · 7 comments · Fixed by #1018

Comments

@dave42w
Copy link
Contributor

dave42w commented Oct 27, 2024

Setting up Robyn locally to prepare for contributions. Testing the documentation in the README.md details below

Preliminary conclusions

  • I didn't have clang installed (sudo apt install clang)
  • It looks like Python 3.13.0 fails (uvloop?)
  • The instructions do not mention git cloning to get started.
  • I've not got things working yet.

I started with this toolchain on Debian 12:

  • Rust 1.82.0
  • Python 3.13.0
  • uv 0.4.27

I used this variation of the readme instructions:

  • Setup a virtual environment
uv init Robyn
  • Install required packages
uv add pre-commit poetry maturin
  • Install development dependencies
uv run poetry install --with dev --with test

First, failure was:

uv run poetry install --with dev --with test
Uninstalled 8 packages in 3ms
Installed 8 packages in 8ms

[tool.poetry] section not found in /home/dave/Code/Robyn/pyproject.toml

Therefore I copied the entire pyproject.toml from gitub.

uv run poetry install --with dev --with test
warning: No `requires-python` value found in the workspace. Defaulting to `>=3.13`.
error: Failed to prepare distributions
  Caused by: Failed to download and build `uvloop==0.19.0`
  Caused by: Build backend failed to build wheel through `build_wheel` (exit status: 1)
...

I figure this is due to Python 3.13.0 so

uv python pin 3.12.7

Also edited .python-version to contain 3.12.7
Try again:

uv run poetry install --with dev --with test
Using CPython 3.12.7
Removed virtual environment at: .venv
Creating virtual environment at: .venv
warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`.
error: Failed to prepare distributions
  Caused by: Failed to build `robyn @ file:///home/dave/Code/Robyn`
  Caused by: Build backend failed to build editable through `build_editable` (exit status: 1)

[stdout]
Running `maturin pep517 build-wheel -i /home/dave/.cache/uv/builds-v0/.tmpEU1nmd/bin/python --compatibility off --editable`

[stderr]
💥 maturin failed
  Caused by: Can't find Cargo.toml (in /home/dave/Code/Robyn)
Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/home/dave/.cache/uv/builds-v0/.tmpEU1nmd/bin/python', '--compatibility', 'off', '--editable'] returned non-zero exit status 1

So I created a Caro.toml copied from github then

uv run poetry install --with dev --with test
warning: No `requires-python` value found in the workspace. Defaulting to `>=3.12`.
error: Failed to prepare distributions
  Caused by: Failed to build `robyn @ file:///home/dave/Code/Robyn`
  Caused by: Build backend failed to build editable through `build_editable` (exit status: 1)

[stdout]
Running `maturin pep517 build-wheel -i /home/dave/.cache/uv/builds-v0/.tmpLOg0kR/bin/python --compatibility off --editable`

[stderr]
💥 maturin failed
  Caused by: Cargo metadata failed. Does your crate compile with `cargo build`?
  Caused by: `cargo metadata` exited with an error: error: failed to parse manifest at `/home/dave/Code/Robyn/Cargo.toml`

Caused by:
  can't find library `robyn`, rename file to `src/lib.rs` or specify lib.path
Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/home/dave/.cache/uv/builds-v0/.tmpLOg0kR/bin/python', '--compatibility', 'off', '--editable'] returned non-zero exit status 1
dave@geeky:~/Code/Robyn$ cargo build
error: failed to parse manifest at `/home/dave/Code/Robyn/Cargo.toml`

Caused by:
  can't find library `robyn`, rename file to `src/lib.rs` or specify lib.path
@sansyrox
Copy link
Member

sansyrox commented Nov 9, 2024

Hey @dave42w 👋

Thanks , will do now

@dave42w
Copy link
Contributor Author

dave42w commented Nov 9, 2024

Hey @dave42w 👋

Thanks , will do now

Thanks!

The upgrade to poetry.lock has helped me.

uv is absolutely awesome.

Upgrades to more recent packages would help as well eg pytest

@sansyrox
Copy link
Member

sansyrox commented Nov 9, 2024

No worries. I'll probably not update to uv in this PR. (I love uv but will be a lot of work for a small PR(happy to accept PRs 😄 )) I will make another issue for it.

@dave42w
Copy link
Contributor Author

dave42w commented Nov 9, 2024

No worries. I'll probably not update to uv in this PR. (I love uv but will be a lot of work for a small PR(happy to accept PRs 😄 )) I will make another issue for it.

Sorry, I agree. uv for everyone would be a big step. Just the steps to make it easier to use newer python with newer packages and remove blockages to uv would be great.

I'd also really appreciate adding a section to cover using a customer build of robyn in your own project. Once you build a Robyn with some changes (maybe testing someone else's PR) how do you move beyond Robyns own unit and integration tests to use that version of Robyn in your own project.

Thanks

@sansyrox
Copy link
Member

sansyrox commented Nov 9, 2024

I'd also really appreciate adding a section to cover using a customer build of robyn in your own project. Once you build a Robyn with some changes (maybe testing someone else's PR) how do you move beyond Robyns own unit and integration tests to use that version of Robyn in your own project.

@dave42w , I don't really get it. Can you explain a bit more?

@dave42w
Copy link
Contributor Author

dave42w commented Nov 9, 2024

I'd also really appreciate adding a section to cover using a customer build of robyn in your own project. Once you build a Robyn with some changes (maybe testing someone else's PR) how do you move beyond Robyns own unit and integration tests to use that version of Robyn in your own project.

@dave42w , I don't really get it. Can you explain a bit more?

Sorry I was unclear.

I have a directory with a clone of github Robyn in it. I make changes and complete the steps to the point where it passes all the tests.

Now I want to use that personal, updated version of Robyn in my own project which is in a different directory/github repository.

What steps do I need to do to replace the released version of Robyn in my project (installed with uv add robyn) with the version that is in the target directories where I have just run the tests?

Does that make more sense?

Oh wow. Is it as simple as

uv add ../Robyn/target/wheels/robyn-0.63.0-cp312-cp312-linux_x86_64.whl 

I assumed that with the rust stuff it would be more complicated

@sansyrox
Copy link
Member

sansyrox commented Nov 9, 2024

No , lol. I thought this was well known. You can use a regular pip install as well

I will add it in the docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants