Skip to content
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
39 changes: 9 additions & 30 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ If you are proposing a new feature:
# Get Started!

Ready to contribute? Here's how to set up `versifier` for local development.
Please note this documentation assumes you already have `poetry` and `Git` installed and ready to go.
Please note this documentation assumes you already have [`uv`](https://docs.astral.sh/uv/) and `Git` installed and ready to go.

1. Fork the `versifier` repo on GitHub.

Expand All @@ -62,36 +62,25 @@ git clone git@github.com:YOUR_NAME/versifier.git
cd versifier
```

If you are using `pyenv`, select a version to use locally. (See installed versions with `pyenv versions`)
Then, install the environment and pre-commit hooks with:

```bash
pyenv local <x.y.z>
make install
```

Then, install and activate the environment with:
This runs `uv sync` and `uv run pre-commit install`.

```bash
poetry install
poetry shell
```

4. Install pre-commit to run linters/formatters at commit time:

```bash
poetry run pre-commit install
```

5. Create a branch for local development:
4. Create a branch for local development:

```bash
git checkout -b name-of-your-bugfix-or-feature
```

Now you can make your changes locally.

6. Don't forget to add test cases for your added functionality to the `tests` directory.
5. Don't forget to add test cases for your added functionality to the `tests` directory.

7. When you're done making changes, check that your changes pass the formatting tests.
6. When you're done making changes, check that your changes pass the formatting tests.

```bash
make check
Expand All @@ -103,25 +92,15 @@ Now, validate that all unit tests are passing:
make test
```

9. Before raising a pull request you should also run tox.
This will run the tests across different versions of Python:

```bash
tox
```

This requires you to have multiple versions of python installed.
This step is also triggered in the CI/CD pipeline, so you could also choose to skip this step locally.

10. Commit your changes and push your branch to GitHub:
7. Commit your changes and push your branch to GitHub:

```bash
git add .
git commit -m "Your detailed description of your changes."
git push origin name-of-your-bugfix-or-feature
```

11. Submit a pull request through the GitHub website.
8. Submit a pull request through the GitHub website.

# Pull Request Guidelines

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
install: ## Install the poetry environment and install the pre-commit hooks
@echo "🚀 Creating virtual environment using uv"
@uv sync
@uv run pre-commit install
@uv tool run pre-commit install

.PHONY: check
check: ## Run code quality tools.
@echo "🚀 Running code quality checks"
@uv run pre-commit run -a
@uv tool run pre-commit run -a

.PHONY: test
test: ## Test the code with pytest
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dev = [
"mypy>=0.971",
"types-toml>=0.10.8.7",
"pytest>=7.0.1",
"pre-commit>=3.0.0",
]

[build-system]
Expand Down
Loading