Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Giacomo Antonioli committed Nov 24, 2023
0 parents commit f3fe0b1
Show file tree
Hide file tree
Showing 37 changed files with 1,409 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[bumpversion]
commit = True
tag = False
current_version = 0.1.0

[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:src/qimp/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

[bumpversion:file(title):CHANGELOG.md]
search = {#}{#} [Unreleased]
replace = {#}{#} [Unreleased]

{#}{#} [{new_version}] - {now:%Y-%m-%d}

[bumpversion:file(links):CHANGELOG.md]
search = [Unreleased]: https://github.com/Giacomo-Antonioli/qimp/compare/v{current_version}...HEAD
replace = [Unreleased]: https://github.com/Giacomo-Antonioli/qimp/compare/v{new_version}...HEAD
[{new_version}]: https://github.com/Giacomo-Antonioli/qimp/compare/v{current_version}...v{new_version}
2 changes: 2 additions & 0 deletions .darglint
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[darglint]
strictness = short
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: 🐛 Bug report
about: Create a report to help us improve
labels: bug
assignees: ''

---

## Expected Behavior


## Actual Behavior


## Steps to Reproduce the Problem

1.
1.
1.

## Specifications

- Version:
- Platform:
- Subsystem:
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
blank_issues_enabled: false
contact_links: []
19 changes: 19 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
name: 🚀 Feature request
about: Suggest an idea for this project
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
7 changes: 7 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Fixes #

## Proposed Changes

-
-
-
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
- package-ecosystem: pip
directory: "/docs"
schedule:
interval: daily
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
41 changes: 41 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "CodeQL"

on:
push:
branches:
pull_request:
branches:
schedule:
- cron: '0 6 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
43 changes: 43 additions & 0 deletions .github/workflows/pre-commit-autoupdate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: "Pre-commit autoupdate"

on:
schedule:
- cron: '0 6 * * 1'
workflow_dispatch:

jobs:
autoupdate:
name: autoupdate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1

- name: Set up Python 3.8
uses: actions/setup-python@v4.7.1
with:
python-version: 3.8

- name: Install system deps
shell: bash
run: |
pip install poetry
poetry config virtualenvs.in-project true
poetry install --no-root --only dev --only linters --sync
- name: Run autoupdate
run: poetry run pre-commit autoupdate

- name: Run pre-commit
run: poetry run pre-commit run --all-files

- uses: peter-evans/create-pull-request@v5.0.2
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: chore-update-pre-commit-hooks
title: Update pre-commit hooks
commit-message: "Update pre-commit hooks"
body: |
# Update pre-commit hooks
- Update pre-commit hooks to the latest version.
delete-branch: true
74 changes: 74 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

name: release

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1

- name: Set up Python 3.8
uses: actions/setup-python@v4.7.1
with:
python-version: 3.8

- name: Install system deps
shell: bash
run: |
pip install poetry
poetry config virtualenvs.in-project true
- name: Build package
run: |
poetry build --ansi
- name: Publish package on PyPI
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Publish package on TestPyPI
uses: pypa/gh-action-pypi-publish@v1.8.10
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository_url: https://test.pypi.org/legacy/


github_release:
needs: release
name: Create Github Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1

- name: Get version from tag
id: tag_name
shell: bash
run: |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2.2.2
with:
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md

- name: Create Release
id: create_release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changelog_reader.outputs.changes }}
draft: false
prerelease: false
106 changes: 106 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: tests

on:
push:
branches:
pull_request:
branches:

jobs:
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1

- name: Set up Python 3.8
uses: actions/setup-python@v4.7.1
with:
python-version: 3.8

- name: Install system deps
shell: bash
run: |
pip install poetry
poetry config virtualenvs.in-project true
poetry install --no-root --only dev --only linters --sync
- name: Linting
shell: bash
run: poetry run pre-commit run --all-files

tests:
needs: linting
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}-latest
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: ['3.8', '3.9', '3.10', '3.11']
fail-fast: true
steps:
- uses: actions/checkout@v4.1.1

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.7.1
with:
python-version: ${{ matrix.python-version }}

- name: Install system deps
shell: bash
run: |
pip install nox-poetry
pip install poetry
poetry config virtualenvs.in-project true
- name: Run mypy with nox
shell: bash
run: nox --force-color -s mypy-${{ matrix.python-version }}

- name: Run tests with nox
shell: bash
run: nox --force-color -s tests-${{ matrix.python-version }}

- name: Run securtity check
if: matrix.python-version == '3.11' && matrix.os == 'Ubuntu'
shell: bash
run: nox --force-color -s security

- name: Upload coverage data
uses: actions/upload-artifact@v2.2.4
with:
name: coverage-data
path: ".coverage.*"

coverage:
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1

- name: Set up Python 3.8
uses: actions/setup-python@v4.7.1
with:
python-version: 3.8

- name: Install system deps
shell: bash
run: |
pip install nox-poetry
pip install poetry
poetry config virtualenvs.in-project true
- name: Download coverage data
uses: actions/download-artifact@v2.0.10
with:
name: coverage-data

- name: Create coverage report
shell: bash
run: |
nox --force-color --session=coverage -- --fmt xml
- name: Upload coverage report
uses: codecov/codecov-action@v3.1.4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Loading

0 comments on commit f3fe0b1

Please sign in to comment.