Skip to content

Commit

Permalink
chore: wip upgrade to poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
aj3sh committed Feb 18, 2025
1 parent 02e7ff4 commit 7517308
Show file tree
Hide file tree
Showing 5 changed files with 527 additions and 34 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Github CI

on:
push:
branches: ['main']
branches: ['main', 'poetry']
pull_request:

jobs:
Expand All @@ -11,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.8']
python-version: ['3.10']

steps:
- uses: actions/checkout@v4
Expand All @@ -24,15 +24,15 @@ jobs:
- name: Install Pipenv
run: |
python -m pip install --upgrade pip
python -m pip install pipenv
python -m pip install poetry
- name: Install dependencies
run: |
pipenv install --dev
poetry install
- name: Run tests with coverage
run: |
pipenv run coverage-xml
poetry run pytest --cov=src/ --cov-report=xml --no-cov-on-fail
- name: Send coverage to CodeCov
uses: codecov/codecov-action@v3
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: '3.10'

- name: Install lint dependencies
run: pip install flake8 mypy isort
Expand Down
71 changes: 46 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,43 +1,64 @@
# How to Contribute
# Contributing Guide

## Install Development Dependencies (Using Pipenv)
Thank you for your interest in contributing to the **commitlint** project!
Your contributions will help improve and enhance this tool.
Please take a moment to review the following guidelines before getting started.

All the dependencies are managed by Pipenv. Please install Pipenv on your system first by following the instructions at [https://pipenv.pypa.io/en/latest/installation.html](https://pipenv.pypa.io/en/latest/installation.html).
## Prerequisites

Once Pipenv is installed, you can install the development dependencies by running the following command:
Before contributing, ensure that you have the following:

```bash
pipenv install --dev
```
- **Python 3.10 or higher** installed. Download it from the [official Python website](https://www.python.org/downloads/).
- **Poetry** installed for dependency management. Follow the [Poetry installation guide](https://python-poetry.org/docs/#installation).

## Getting Started

To set up the project on your local machine, follow these steps:

1. **Fork** the repository on GitHub.
2. **Clone** the forked repository to your local machine:

```bash
git clone https://github.com/<your-username>/commitlint.git
cd commitlint
```

3. **Install dependencies**:

```bash
poetry install
```

## Install pre-commit hooks
4. **Verify your setup**:

To install pre-commit and commit-msg hook for this project, run the following command:
```bash
poetry run commitlint --version
```

## Tests

Run tests

```bash
pipenv run install-hooks
poetry run pytest
```

## Run tests

Run the tests using the below command:
Run tests with coverage

```bash
pipenv run test
poetry run pytest --cov=src
```

## Before submitting
Generate html coverage

Before submitting your Pull Request, please do the following steps:
```bash
poetry run pytest --cov=src/ --cov-report=html
```

1. Add any changes you want.
1. Add tests for the new changes.
1. Edit documentation (`README.md`) if you have changed something significant.
1. Commit your changes using [semantic commit message](https://seesparkbox.com/foundry/semantic_commit_messages).
Examples: `"fix: Fixed foobar bug"`, `"feat(accounts): Added foobar feature on accounts"`.
## Use pre-commit hook

## Other help
Install pre-commit hook using the command below.

You can contribute by spreading a word about this library.
It would also be a huge contribution to write a short article on how you are using this project.
You can also share your best practices with us.
```bash
poetry run pre-commit install --hook-type pre-commit --hook-type commit-msg
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ runs:
- name: Install Python
uses: actions/[email protected]
with:
python-version: '3.8'
python-version: '3.10'

- name: Commitlint Action
id: commitlint
Expand Down
Loading

0 comments on commit 7517308

Please sign in to comment.