Skip to content

Commit

Permalink
No issue. Add GitHub templates and actions, move to poetry and pyproj…
Browse files Browse the repository at this point in the history
…ect.toml
  • Loading branch information
reckart committed Mar 19, 2024
1 parent dad128b commit 9acba6f
Show file tree
Hide file tree
Showing 13 changed files with 1,104 additions and 85 deletions.
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
name: Bug report
about: Create a report to help us improve

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. ...
2. ...

If possible, attach a minimal file that triggers the error.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Error message**
If applicable, add the error message to help explain your problem.

**Please complete the following information:**
- Version: [Please fill in the version number]
- OS: [e.g. Windows, Linux, OS X]

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**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.
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/refactoring.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: Refactoring (for developers)
about: Refactor the application

---

**Describe the refactoring action**
A clear and concise description of what the action is.

**Expected benefit**
A clear and concise description of what you expect to improve by the refactoring.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Release
about: Create a new release of cassis

---

**Checklist**

- [ ] Make sure all issues for the milestone are completed, otherwise move them
- [ ] Checkout the `main` branch
- [ ] Bump the version in `cassis/__version__.py` to a stable one, e.g. `__version__ = "0.6.0"`, commit and push
- [ ] Check and wait that the build completed.
- [ ] Create a tag for that version and push it
- [ ] Wait for the build and Pypi to show the new version
- [ ] Bump the version to the next development version, commit and push that.
- [ ] Convert the tag to a release on Github, write release note based on issues in the respective milestone
- [ ] Create a new milestone
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
**What's in the PR**
* ...

**How to test manually**
* ...

**Automatic testing**
* [ ] PR includes unit tests

**Documentation**
* [ ] PR updates documentation
41 changes: 41 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Run Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v4

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

- name: Install dependencies
run: |
pip install poetry
make dependencies
- name: Lint with flake8
run: make lint

# - name: Run tests
# run: make coverage

# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# file: ./coverage.xml
# env_vars: OS,PYTHON
# name: codecov-umbrella
# token: ${{ secrets.CODECOV_TOKEN }}
10 changes: 0 additions & 10 deletions MANIFEST.in

This file was deleted.

46 changes: 39 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,41 @@
test:
python -m pytest tests/
.PHONY: docs tests

black:
black -l 120 inception/
black -l 120 tests/
# Dependencies
dependencies:
poetry install

html:
cd docs && make html
# Tests
unit-tests:
poetry run py.test --cov=pycaprio --cov-branch --cov-fail-under=90 tests/unit_tests

integ-tests:
poetry run py.test --cov=pycaprio --cov-branch --cov-fail-under=90 tests/integ_tests

tests: unit-tests integ-tests

coverage:
poetry run py.test --cov=pycaprio --cov-branch --cov-fail-under=90 --cov-report=xml:coverage.xml tests

# Static analysis/linting
lint:
poetry run flake8 pycaprio --max-line-length=120
poetry run flake8 tests --max-line-length=120 --ignore=E722

# Docs
docs:
poetry run mkdocs serve

# Building and publishing
build: unit-tests lint
poetry build

publish: build
poetry publish

# CI

ci-publish:
poetry publish --build --username "${PYPI_USERNAME}" --password "${PYPI_PASSWORD}" --no-interaction

ci-bump-version:
poetry run bump2version patch
1 change: 0 additions & 1 deletion inception/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
__version__ = "0.0.1"
Loading

0 comments on commit 9acba6f

Please sign in to comment.