-
Notifications
You must be signed in to change notification settings - Fork 22
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
Hatch to manage Python virtualenvs #87
Changes from 11 commits
d9eddd0
c97bcc7
ab88b3c
5ecf93c
5b35ac3
50bee53
74a51fe
8af19b5
fa17880
5e94928
5040782
8879012
0196977
1decca5
e26484c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,10 +2,7 @@ | |
name = "y-py" | ||
version = "0.5.4" | ||
rust-version = "1.58" | ||
authors = ["John Waidhofer <[email protected]>", "Kevin Jahns <[email protected]>", "Pierre-Olivier Simonard <[email protected]>"] | ||
edition = "2018" | ||
homepage = "https://github.com/y-crdt/ypy" | ||
repository = "https://github.com/y-crdt/ypy" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,28 +39,28 @@ assert value == "hello world!" | |
|
||
## Development Setup | ||
|
||
0. Install Rust and Python | ||
1. Install `maturin` in order to build Ypy | ||
0. [Install Rust](https://www.rust-lang.org/tools/install) and [Python](https://www.python.org/downloads/) | ||
- Some alternative bootstrapping options are [pyenv](https://github.com/pyenv/pyenv) for Python, or using [mamba](https://github.com/conda-forge/miniforge) to `mamba install rust python`. | ||
1. Install [hatch](https://hatch.pypa.io/latest/install/) (`python -m pip install hatch`) | ||
2. Create a development build of the library | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should remain agnostic to the users' package manager of choice in the setup. If we provide the default instructions with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm good with whatever wording you want to use here. I think the original docs got across the point that you need bootstrapping before being able to build ypy, and these do as well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for this section, lets keep it simple and use the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not entirely sure what tweaks you're asking for but I'm 👍 if you want to commit directly to the PR with the wording you'd like to see here. I think this may be the last item to resolve in the PR? |
||
|
||
*Make sure to `unset CONDA_PREFIX` if you are in a conda environment. If `hatch` is not found on your PATH, you can run `python -m hatch` instead* | ||
``` | ||
pip install maturin | ||
hatch run maturin develop | ||
``` | ||
|
||
2. Create a development build of the library | ||
`maturin develop` | ||
|
||
## Tests | ||
|
||
All tests are located in `/tests`. You can run them with `pytest`. | ||
All tests are located in `/tests`. There is a `test` environment matrix defined in `pyproject.toml` that will run `pytest` against `py37` through `py310`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is cool! |
||
|
||
``` | ||
pytest | ||
hatch run test:pytest | ||
``` | ||
|
||
## Build Ypy : | ||
|
||
Build the library as a wheel and store them in `target/wheels` : | ||
Build the library as a wheel and store them in `target/wheels`: | ||
|
||
``` | ||
maturin build | ||
hatch run maturin build | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,20 @@ | ||
[build-system] | ||
requires = ["maturin>=0.13,<0.14"] | ||
build-backend = "maturin" | ||
|
||
[project] | ||
name = "y-py" | ||
version = "0.5.4" | ||
description = "Python bindings for the Y-CRDT built from yrs (Rust)" | ||
authors = [ | ||
{ name = "John Waidhofer", email = "[email protected]" }, | ||
{ name = "Kevin Jahns", email = "[email protected]" }, | ||
{ name = "Pierre-Olivier Simonard", email = "[email protected]" } | ||
] | ||
readme = "README.md" | ||
homepage = "https://github.com/y-crdt/ypy" | ||
repository = "https://github.com/y-crdt/ypy" | ||
dependencies = ["pytest", "maturin"] | ||
|
||
[[tool.hatch.envs.test.matrix]] | ||
python = ["37", "38", "39", "310"] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Related to my comment above, lets keep the support for hatch within the build system. So this is great!
kafonek marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what happens if we try
hatch run test:pytest
here, presumably since there's only one version of Python on the runner then it's effectively the same ashatch run pytest
.