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

feat: Enable testing with python versions 3.10 and 3.11 via tox #194

Merged
merged 1 commit into from
Jul 20, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,10 @@ pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
xmlcov/
.pkg/
.pkg/**
.tox/
.tox/**
.nox/
.coverage
.coverage.*
Expand Down
30 changes: 16 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ Hello from SlickML🧞 Team 👋 and welcome to our contributing guidelines 🤗


## 🔗 Quick Links
* [Code of Conduct](#️code-of-conduct)
* [Getting Started](#getting-started)
* [Coding Standards](#coding-standards)
* [Environment Management](#environment-management)
* [Formatting](#formatting)
* [Linting](#linting)
* [Testing](#testing)
* [Documentation](#documentation)
* [Pull Requests](#pull-requests)
* [Need Help?](#need-help)
- [🧑‍💻🤝 Contributing to SlickML🧞](#-contributing-to-slickml)
- [🔗 Quick Links](#-quick-links)
- [👩‍⚖️ Code of Conduct](#️--code-of-conduct)
- [🚀🌙 Getting Started](#-getting-started)
- [📐 Coding Standards](#-coding-standards)
- [🐍 🥷 Environment Management](#--environment-management)
- [🛠 Formatting](#-formatting)
- [🪓 Linting](#-linting)
- [🧪 Testing](#-testing)
- [📖 Documentation](#-documentation)
- [🔥 Pull Requests](#-pull-requests)
- [❓ 🆘 📲 Need Help?](#---need-help)


## 👩‍⚖️ Code of Conduct
Expand Down Expand Up @@ -63,13 +65,13 @@ Please note that before starting any major work, open an issue describing what y
sudo apt install build-essential gfortran
```
- All developments are done via [*python-poetry*](https://python-poetry.org/). To begin with, first install `poetry` (version >=1.2.0) following the [*installation documentation*](https://python-poetry.org/docs/#installation) depending on your operating system.
- You can also easily [*manage your Python environments*](https://python-poetry.org/docs/managing-environments#managing-environments) and easily switch between environments via `poetry`. To set the `poetry` environment using your preferred `python` version (i.e. `3.9.13`), which is already installed on your system preferably via `pyenv`, simply run 🏃‍♀️ :
- You can also easily [*manage your Python environments*](https://python-poetry.org/docs/managing-environments#managing-environments) and easily switch between environments via `poetry`. To set the `poetry` environment using your preferred `python` version (i.e. `3.9.18`), which is already installed on your system preferably via `pyenv`, simply run 🏃‍♀️ :
```
poetry env use 3.9.13
poetry env use 3.9.18
```
- Once you setup your environment, to install the dependencies (`poetry.lock`), simply run 🏃‍♀️ :
```
poetry install
poetry install --all-extras
```
- We mainly use [*Poe the Poet*](https://github.com/nat-n/poethepoet), a pythonic task runner that works well with `poetry`.
- To make sure your environmnet is setup correctly, simply run 🏃‍♀️ :
Expand Down Expand Up @@ -167,7 +169,7 @@ Please note that before starting any major work, open an issue describing what y
```
poe tox
```
🔔 Sometimes, `tox` is unhappy; so, don't hesitate to run `poe tox` twice 😁 .
🔔 Please note that, we are currently running `tox` against `python versions 3.9, 3.10, and 3.11`. Therefore, you can leverage `pyenv` and install these versions and use `pyenv local` command (i.e. `pyenv local 3.9.X 3.10.Y 3.11.Z`) to activate them before running `poe tox`.
8. Now, you are ready to push your changes to your forked repository.
9. Lastly, open a PR in our repository to the `master` branch and follow the PR template so that we can efficiently review the changes as soon as possible and get your feature/bug-fix merged.
10. Nicely done! You are all set! You are now officially part of [SlickML contributors](https://github.com/slickml/slick-ml/graphs/contributors).
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ Please note that before starting any major work, open an issue describing what y
sudo apt install build-essential gfortran
```
- All developments are done via [*python-poetry*](https://python-poetry.org/). To begin with, first install `poetry` (version >=1.2.0) following the [*installation documentation*](https://python-poetry.org/docs/#installation) depending on your operating system.
- You can also easily [*manage your Python environments*](https://python-poetry.org/docs/managing-environments#managing-environments) and easily switch between environments via `poetry`. To set the `poetry` environment using your preferred `python` version (i.e. `3.9.13`) which is already installed on your system preferably via `pyenv`, simply run 🏃‍♀️ :
- You can also easily [*manage your Python environments*](https://python-poetry.org/docs/managing-environments#managing-environments) and easily switch between environments via `poetry`. To set the `poetry` environment using your preferred `python` version (i.e. `3.9.18`) which is already installed on your system preferably via `pyenv`, simply run 🏃‍♀️ :
```
poetry env use 3.9.13
poetry env use 3.9.18
```
- Once you setup your environment, to install the dependencies (`poetry.lock`), simply run 🏃‍♀️ :
```
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ or ``-h`` command. For example, to see all available commands, simply run 🏃
- In order to avoid any potential conflicts with other installed Python packages, it is
recommended to use a virtual environment, e.g. [python poetry](https://python-poetry.org/), [python virtualenv](https://docs.python.org/3/library/venv.html), [pyenv virtualenv](https://github.com/pyenv/pyenv-virtualenv), or [conda environment](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html).
- We highly recommend to manage your projects using `python-poetry`. All **SlickML** developments are done via [*python-poetry*](https://python-poetry.org/). To begin with, first install `poetry` following the [*installation documentation*](https://python-poetry.org/docs/#installation) depending on your operating system.
- You can also easily [*manage your Python environments*](https://python-poetry.org/docs/managing-environments#managing-environments) and easily switch between environments via `poetry`. To set the `poetry` environment using your preferred `python` version (i.e. `3.9.13`) which is already installed on your system preferably via `pyenv`, simply run 🏃‍♀️ :
- You can also easily [*manage your Python environments*](https://python-poetry.org/docs/managing-environments#managing-environments) and easily switch between environments via `poetry`. To set the `poetry` environment using your preferred `python` version (i.e. `3.9.18`) which is already installed on your system preferably via `pyenv`, simply run 🏃‍♀️ :
```
poetry env use 3.9.13
poetry env use 3.9.18
```
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ cmd = """
dist/
.mypy_cache/
.pytest_cache/
.tox/
.tox
htmlcov/
xmlcov/
**/__pycache__/
Expand Down Expand Up @@ -202,7 +202,7 @@ cmd = "poetry run sphinx-build -b html docs/ docs/_build"

[tool.poe.tasks.tox]
help = "Test environments via tox"
cmd = "poetry run tox -c tox.ini ."
cmd = "poetry run tox --conf=tox.ini --root=."

[tool.poe.tasks.format]
help = "Apply all formatting steps."
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

[tox]
isolated_build = True
envlist = py39
# TODO(amir): add `3.12` once glmnet adds the wheel.
# https://github.com/replicahq/python-glmnet/issues/5
envlist = py{39,310,311}

[testenv]
allowlist_externals = poetry
Expand All @@ -19,5 +21,4 @@ commands =
poe check
poe test
poe sphinx
poetry build
poe clean
poetry build
Loading