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

[RFC] move to PEP 621 compliant package manager for better extras #905

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,26 +26,26 @@ repos:
hooks:
- id: isort
name: isort-local
entry: poetry run isort
entry: rye run isort
language: system
types: [python]
pass_filenames: true
- id: flake8
name: flake8-local
entry: poetry run flake8
entry: rye run flake8
language: system
types: [python]
pass_filenames: true
- id: mypy
name: mypy-local
entry: poetry run mypy
entry: rye run mypy
language: python
types: [python]
exclude: ^examples/|^truss/test.+/|model.py$|^truss-chains/.*
pass_filenames: true
- id: mypy
name: mypy-local (3.9)
entry: poetry run mypy
entry: rye run mypy
language: python
types: [python]
files: ^truss-chains/.*
Expand Down
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.11
3.10.13
2 changes: 0 additions & 2 deletions .tool-versions

This file was deleted.

6 changes: 3 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"[python]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true,
"source.sortMembers": true
"source.fixAll": "explicit",
"source.organizeImports": "explicit",
"source.sortMembers": "explicit"
}
}
}
33 changes: 15 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,34 @@ We use GitHub features for project management on Truss:
To get started contributing to the library, all you have to do is clone this repository!

### Setup
We use [`rye`](https://rye-up.com/) to manage Python environments, packaging (via [`hatchiling`](https://hatch.pypa.io/latest/)), and depdencies.
bolasim marked this conversation as resolved.
Show resolved Hide resolved

**PLEASE NOTE:** the ML ecosystem in general is still not well supported on M1 Macs, and as such, we do not recommend or support local development on M1 for Truss. Truss is well-optimized for use with GitHub Codespaces and other container-based development environments.

We use `asdf` to manage Python binaries and `poetry` to manage Python dependencies.

For development in a macOS environment, we use `brew` to manage system packages.
For development:

```bash
# Install asdf (or use another method https://asdf-vm.com/)
brew install asdf

# Install `asdf` managed python and poetry
asdf plugin add python
asdf plugin add poetry
asdf install
# Install rye: https://rye-up.com/guide/installation/#installing-rye
curl -sSf https://rye-up.com/get | bash

# Install poetry dependencies
poetry install
# Add to shell
echo 'source "$HOME/.rye/env"' >> ~/.bashrc

# And finally precommit
poetry run pre-commit install
# Setup environment (includes python version and dependencies)
rye sync
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is pre-commit automatically installed by rye?

```

Then to run the entire test suite

```bash
poetry run pytest truss/tests
rye run pytest truss/tests
```
### Build Wheel for release
TODO: thils will automated in CI soon
```bash
rye build --wheel --pyproject ./pyproject.toml --clean --verbose
```

## Documentation

To learn about Truss see the [official documentation](https://truss.baseten.co).

Contributions to documentation are very welcome! Simply edit the appropriate markdown files in the `docs/` folder and make a pull request. For larger changes, tutorials, or any questions please contact [team@trussml.com](mailto:team@trussml.com).
Contributions to documentation are very welcome! Simply edit the appropriate markdown files in the `docs/` folder and make a pull request. For larger changes, tutorials, or any questions please contact [hi@baseten.co](mailto:hi@baseten.co).
Loading
Loading