Skip to content

Commit e645cba

Browse files
authored
PR: major refactoring, docs and tests
refactor: major refactoring, docs and tests
2 parents d58d2c5 + 1a90aea commit e645cba

35 files changed

+4349
-1460
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: 🐛 Bug report
3+
about: If something isn't working 🔧
4+
title: ''
5+
labels: bug
6+
assignees:
7+
---
8+
9+
## Bug Report
10+
11+
<!-- A clear and concise description of what the bug is. -->
12+
13+
## How To Reproduce
14+
15+
Steps to reproduce the behavior:
16+
17+
### Code sample
18+
19+
<!-- If applicable, attach a minimal code sample to reproduce the decried issue. -->
20+
21+
### Environment
22+
23+
* OS: [e.g. Linux / Windows / macOS]
24+
* Python version, get it with:
25+
26+
```bash
27+
python --version
28+
```
29+
30+
### Screenshots
31+
32+
<!-- If applicable, add screenshots to help explain your problem. -->
33+
34+
## Expected behavior
35+
36+
<!-- A clear and concise description of what you expected to happen. -->
37+
38+
## Additional context
39+
40+
<!-- Add any other context about the problem here. -->

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Configuration: https://help.github.com/en/github/building-a-strong-community/configuring-issue-templates-for-your-repository
2+
3+
blank_issues_enabled: false
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: 🚀 Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: enhancement
6+
assignees:
7+
---
8+
9+
## Feature Request
10+
11+
<!-- A clear and concise description of the feature proposal. -->
12+
13+
## Motivation
14+
15+
<!-- Please describe the motivation for this proposal. -->
16+
17+
## Alternatives
18+
19+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
20+
21+
## Additional context
22+
23+
<!-- Add any other context or screenshots about the feature request here. -->

.github/ISSUE_TEMPLATE/question.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: ❓ Question
3+
about: Ask a question about this project 🎓
4+
title: ''
5+
labels: question
6+
assignees:
7+
---
8+
9+
## Checklist
10+
11+
<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->
12+
13+
- [ ] I've searched the project's [`issues`](https://github.com/lgrcia/twirl/issues?q=is%3Aissue).
14+
15+
## Question
16+
17+
<!-- What is your question -->
18+
19+
## Additional context
20+
21+
<!-- Add any other context or screenshots about the feature request here. -->

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
## Description
2+
3+
<!-- Add a more detailed description of the changes if needed. -->
4+
5+
## Related Issue
6+
7+
<!-- If your PR refers to a related issue, link it here. -->
8+
9+
## Type of Change
10+
11+
<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->
12+
13+
- [ ] Examples / docs / tutorials / dependencies update
14+
- [ ] Bug fix (non-breaking change which fixes an issue)
15+
- [ ] Improvement (non-breaking change which improves an existing feature)
16+
- [ ] New feature (non-breaking change which adds functionality)
17+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
18+
- [ ] Security fix
19+
20+
## Checklist
21+
22+
<!-- Mark with an `x` all the checkboxes that apply (like `[x]`) -->
23+
24+
- [ ] I've read the [`CODE_OF_CONDUCT.md`](https://github.com/lgrcia/twirl/blob/master/CODE_OF_CONDUCT.md) document.
25+
- [ ] I've read the [`CONTRIBUTING.md`](https://github.com/lgrcia/twirl/blob/master/CONTRIBUTING.md) guide.
26+
- [ ] I've updated the code style using [black](https://black.readthedocs.io/en/stable/).
27+
- [ ] I've written tests for all new methods and classes that I created.
28+
- [ ] I've written the docstring in [numpy style](https://numpydoc.readthedocs.io/en/latest/format.html#documenting-classes) for all the methods and classes that I used.

.github/workflows/publish.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: twirl/publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
jobs:
11+
ci:
12+
name: Build & Publish w/Poetry
13+
14+
strategy:
15+
matrix:
16+
python-version: ["3.10"]
17+
os: [ ubuntu-latest ]
18+
19+
runs-on: ${{ matrix.os }}
20+
21+
env:
22+
PROJECT_NAME: "Twirl"
23+
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
24+
25+
steps:
26+
- name: Checkout 🛎
27+
uses: actions/checkout@v3
28+
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Install Poetry
35+
uses: snok/install-poetry@v1
36+
37+
- name: Setup Poetry Configuration 🛠️
38+
run: poetry config pypi-token.pypi $PYPI_API_TOKEN
39+
40+
- name: Install Dependencies
41+
run: poetry install --no-root --no-dev
42+
43+
- name: Build Package 🐍
44+
run: poetry build
45+
46+
- name: Dry-run Publish to PyPI 😬
47+
run: poetry publish --dry-run
48+
49+
- name: Publish to PyPI 🚀
50+
run: poetry publish --skip-existing

.github/workflows/test.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Python package
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Set up Python 3.10
11+
uses: actions/setup-python@v4
12+
with:
13+
python-version: "3.10"
14+
- name: Install dependencies
15+
run: |
16+
python -m pip install -U pip poetry
17+
python -m poetry install --with test
18+
- name: Test with pytest
19+
run: |
20+
python -m poetry run python -m pytest

.gitignore

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,12 @@
55
dist
66
build
77

8+
# poetry
89
.venv
910
.env
10-
.ruff*
1111

12-
.pytest_cache
12+
# local dev and docs
13+
**__pycache__
14+
docs/_build
15+
.DS_Store
16+
.ruff*

.readthedocs.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "3.8"
7+
jobs:
8+
post_create_environment:
9+
- pip install poetry
10+
- poetry config virtualenvs.create false
11+
post_install:
12+
- poetry install --with docs
13+
14+
sphinx:
15+
configuration: docs/conf.py

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@
1313
},
1414
"editor.formatOnPaste": false,
1515
"editor.defaultFormatter": "ms-python.black-formatter"
16-
}
16+
},
17+
"python.testing.pytestArgs": [
18+
"tests"
19+
],
20+
"python.testing.unittestEnabled": false,
21+
"python.testing.pytestEnabled": true
1722
}

0 commit comments

Comments
 (0)