diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 00000000..465270a1 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,41 @@ +# Contribution Guidelines + +Thank you for considering contributing! We welcome contributions in the form of bug reports, feature requests, code patches, or documentation improvements. + +Please follow these guidelines to ensure a smooth contribution process. + +## Bug Reports + +If you've found a bug, please create a bug report. Make sure to provide the following information: + +- **Environment Information:** (e.g., mytoyota version, Python version) +- **Steps to Reproduce the Bug:** +- **Expected Behavior:** +- **Current Behavior:** + +## Feature Requests + +If you have an idea for a new feature, please create a feature request. Describe the desired feature and why it would be useful. + +## Code Contributions + +We welcome code contributions! If you'd like to participate in development, follow these steps: + +1. Fork this repository. +2. Create a branch for your changes: e.g `git checkout -b feature/feature_description` or `git checkout -b bug/bug_description`. +3. Develop and test your changes. +4. Ensure your code complies with style guidelines: `poetry run pre-commit run --all-files`. +5. Create a pull request in this repository with a clear description of the changes. + +### Development Requirements + +- Dependencies are managed with [Poetry](https://python-poetry.org/). Add new dependencies to the `pyproject.toml` file and run `poetry install`. +- Style guidelines are enforced with [pre-commit](https://pre-commit.com/). Install pre-commit with `poetry run pre-commit install`. + +### Tests + +Ensure that all tests pass successfully before creating a pull request. + +```bash +poetry run pytest +``` diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bad1220f..1be65e20 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,15 +1,14 @@ +--- version: 2 updates: - - package-ecosystem: pip + - package-ecosystem: "pip" directory: "/" - versioning-strategy: lockfile-only + versioning-strategy: "lockfile-only" schedule: - interval: weekly - labels: - - "dependencies" - - package-ecosystem: github-actions + interval: "weekly" + labels: [":robot: bot", ":game_die: dependencies"] + - package-ecosystem: "github-actions" directory: "/" schedule: - interval: weekly - labels: - - "dependencies" + interval: "weekly" + labels: [":robot: bot", ":game_die: dependencies"] diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 00000000..f43adada --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,71 @@ +--- +# the GitHub Action https://github.com/marketplace/actions/github-labeler. +- name: ":bell: automerge" + color: "8f4fbc" + description: "" +- name: ":robot: bot" + color: "69cde9" + description: "" +- name: ":bug: bug" + color: "b60205" + description: "" +- name: ":warning: breaking change" + color: "b60205" + description: "" +- name: ":game_die: dependencies" + color: "0366d6" + description: "" +- name: ":memo: documentation" + color: "c5def5" + description: "" +- name: ":busts_in_silhouette: duplicate" + color: "cccccc" + description: "" +- name: ":speech_balloon: translation" + color: "b2a8a6" + description: "" +- name: ":wrench: enhancement" + color: "0054ca" + description: "" +- name: ":rocket: feature" + color: "0e8a16" + description: "" +- name: ":mega: feedback" + color: "03a9f4" + description: "" +- name: ":clock10: future maybe" + color: "fef2c0" + description: "" +- name: ":hatching_chick: good first issue" + color: "7057ff" + description: "" +- name: ":pray: help wanted" + color: "4caf50" + description: "" +- name: ":no_entry_sign: invalid" + color: "e6e6e6" + description: "" +- name: ":mag: investigate" + color: "e6625b" + description: "" +- name: ":thinking: needs more info" + color: "795548" + description: "" +- name: ":pushpin: pinned" + color: "28008e" + description: "" +- name: ":question: question" + color: "3f51b5" + description: "" +- name: ":skull: stale" + color: "237da0" + description: "" +- name: ":eyes: upstream" + color: "fbca04" + description: "" +- name: ":construction_worker: WIP" + color: "668000" + description: "" +- name: ":coffin: wontfix" + color: "ffffff" + description: "" diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 53926e1e..0104142f 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -3,23 +3,17 @@ tag-template: "v$RESOLVED_VERSION" sort-direction: ascending categories: - title: "โš  Breaking changes" - label: "breaking change" + labels: [":warning: breaking change"] - title: "๐Ÿš€ Features" - labels: - - "feature" + labels: [":rocket: feature"] - title: "๐Ÿ”ง Code enhancements" - labels: - - "enhancement" + labels: [":wrench: enhancement"] - title: "๐Ÿ› Bug Fixes" - labels: - - "fix" - - "bugfix" - - "bug" + labels: [":bug: bug"] + - title: "๐Ÿˆต Translations" + labels: [":speech_balloon: translation"] - title: "๐Ÿ“„ Documentation" - label: "documentation" - - title: "๐Ÿงฑ Dependency Updates" - labels: - - "dependencies" + labels: [":memo: documentation"] change-template: "- $TITLE @$AUTHOR (#$NUMBER)" change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. template: | diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cc628604..60065374 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,44 +1,34 @@ # This workflow will install Python dependencies, run tests and lint with a variety of Python versions # For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions -name: Build package +name: "Build package" on: push: - branches: - - master - - "v0.7" + branches: ["master", "main"] pull_request: - branches: - - master - - "v0.7" + branches: ["master", "main"] jobs: build: - runs-on: ${{ matrix.os }} + runs-on: "${{ matrix.os }}" strategy: matrix: - os: [macos-latest, ubuntu-latest, windows-latest] + os: ["macos-latest", "ubuntu-latest", "windows-latest"] python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] fail-fast: false - steps: - - name: Check out the repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: "โคต๏ธ Check out code from GitHub" + uses: "actions/checkout@v4" + - name: "๐Ÿ Set up Python ${{ matrix.python-version }}" + uses: "actions/setup-python@v4" with: - python-version: ${{ matrix.python-version }} - - - name: Install Poetry - uses: abatilo/actions-poetry@v2.3.0 + python-version: "${{ matrix.python-version }}" + - name: "โš™๏ธ Install Poetry" + uses: "abatilo/actions-poetry@v2.3.0" with: poetry-version: 1.5.1 - - - name: Install dependencies - run: poetry install - - - name: Test package building - run: | - poetry build + - name: "โš™๏ธ Install dependencies" + run: "poetry install" + - name: "๐Ÿš€ Test package building" + run: "poetry build" diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml new file mode 100644 index 00000000..f97d89bc --- /dev/null +++ b/.github/workflows/labeler.yml @@ -0,0 +1,18 @@ +--- +name: "Manage labels" + +on: + schedule: + - cron: "0 0 * * *" + +jobs: + labeler: + name: "Labeler" + runs-on: "ubuntu-latest" + steps: + - name: "โคต๏ธ Check out code from GitHub" + uses: "actions/checkout@v4" + - name: "๐Ÿš€ Run Labeler" + uses: "crazy-max/ghaction-github-labeler@v5" + with: + skip-delete: false diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 203f5e35..e7c43c29 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -1,54 +1,46 @@ -name: Linting +name: "Linting" on: push: - branches: - - master - - "v0.7" + branches: ["master", "main"] pull_request: jobs: pre-commit: - name: Pre-commit + name: "Pre-commit" strategy: matrix: python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" env: - OS: ubuntu-latest - PYTHON: ${{ matrix.python-version }} + OS: "ubuntu-latest" + PYTHON: "${{ matrix.python-version }}" steps: - - name: Check out the repository - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + - name: "โคต๏ธ Check out code from GitHub" + uses: "actions/checkout@v4" + - name: "๐Ÿ Set up Python ${{ matrix.python-version }}" + uses: "actions/setup-python@v4" with: - python-version: ${{ matrix.python-version }} - - - name: Install Poetry - uses: abatilo/actions-poetry@v2.3.0 + python-version: "${{ matrix.python-version }}" + - name: "โš™๏ธ Install Poetry" + uses: "abatilo/actions-poetry@v2.3.0" with: poetry-version: 1.5.1 - - - name: Install dependencies - run: poetry install - - - name: Run pre-commit on all files + - name: "โš™๏ธ Install dependencies" + run: "poetry install" + - name: "๐Ÿš€ Run pre-commit on all files" run: | poetry run pre-commit run --all-files --show-diff-on-failure --color=always - - - name: Run pytest with coverage + - name: "๐Ÿš€ Run pytest with coverage" run: | poetry run pip install coverage poetry run coverage run -m pytest poetry run coverage xml - - - name: Upload Coverage to Codecov - uses: codecov/codecov-action@v3 + - name: "โฌ†๏ธ Upload Coverage to Codecov" + uses: "codecov/codecov-action@v3" with: - token: ${{ secrets.CODECOV_TOKEN }} + token: "${{ secrets.CODECOV_TOKEN }}" env_vars: OS,PYTHON fail_ci_if_error: true - flags: unittests + flags: "unittests" verbose: true diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 1265de06..20147136 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -1,17 +1,18 @@ # This workflow will upload a Python Package using Twine when a release is created # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries -name: Upload Python Package to PyPi +name: "Upload Python Package to PyPi" on: release: - types: [published] + types: ["published"] jobs: build: - runs-on: ubuntu-latest + runs-on: "ubuntu-latest" steps: - - uses: actions/checkout@v4 - - name: Build package and publish to pypi - uses: JRubics/poetry-publish@v1.17 + - name: "โคต๏ธ Check out code from GitHub" + uses: "actions/checkout@v4" + - name: "๐Ÿš€ Build package and publish to pypi" + uses: "JRubics/poetry-publish@v1.17" with: - pypi_token: ${{ secrets.PYPI_PASSWORD }} + pypi_token: "${{ secrets.PYPI_PASSWORD }}" diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 97d4952b..fece9c63 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -1,17 +1,15 @@ -name: Draft a release note +name: "Draft a release note" on: push: - branches: - - master - - "v0.7" + branches: ["master", "main"] jobs: draft_release: - name: Release Drafter - runs-on: ubuntu-latest + name: "Release Drafter" + runs-on: "ubuntu-latest" steps: - - name: Run release-drafter - uses: release-drafter/release-drafter@v5 + - name: "๐Ÿš€ Run release-drafter" + uses: "release-drafter/release-drafter@v5" env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"