Skip to content

Commit

Permalink
Initial content
Browse files Browse the repository at this point in the history
  • Loading branch information
jacklinke committed Oct 10, 2024
1 parent ee11c2e commit e04a774
Show file tree
Hide file tree
Showing 66 changed files with 2,239 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"_checkout": "2024.05.3",
"_output_dir": "/home/watervize/omenapps_packages",
"_repo_dir": "/home/watervize/.cookiecutters/cookiecutter-django-package",
"_template": "gh:OmenApps/cookiecutter-django-package",
"author": "Jack Linke",
"copyright_year": "2024",
"development_status": "Development Status :: 1 - Planning",
"docker_compose_python_version": "3.12",
"email": "jacklinke@gmail.com",
"github_owner": "OmenApps",
"github_user": "jacklinke",
"license": "MIT",
"package_description": "Weather from the Open Weather Map APIs",
"package_name": "django_owm",
"project_name": "django-owm",
"use_playwright": "n",
"use_postgres": "n",
"version": "2024.10.1"
}
2 changes: 2 additions & 0 deletions .darglint
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[darglint]
strictness = long
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.{py,toml}]
indent_style = space
indent_size = 4

[*.yml,yaml,json]
indent_style = space
indent_size = 2
10 changes: 10 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[flake8]
select = B,B9,C,D,DAR,E,F,N,RST,W
ignore = E203,E501,RST201,RST203,RST301,W503
max-line-length = 120
max-complexity = 10
docstring-convention = google
rst-roles = class,const,func,meth,mod,ref
rst-directives = deprecated
count = true
exclude = .git,.nox,__pycache__,dist,migrations
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
39 changes: 39 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Bug report
about: Create a report to help us improve the package
title: ""
labels: ""
assignees: ""
---

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

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

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

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Browser (please complete the following information):**

- Type [e.g. chrome, safari, etc]
- Version [e.g. 22]

**Database (please complete the following information):**

- Device: [e.g. iPhone6]
- Database Version [e.g. 22]
- Running local, remote (e.g. DBaaS), or locally with provided docker-compose
- OS running on: [e.g. Ubuntu 20.04]

**Additional context**
Add any other context about the problem here.
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
title: ""
labels: ""
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.
21 changes: 21 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/.github/workflows"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/docs"
schedule:
interval: weekly
- package-ecosystem: pip
directory: "/"
schedule:
interval: weekly
versioning-strategy: lockfile-only
allow:
- dependency-type: "all"
66 changes: 66 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
# Labels names are important as they are used by Release Drafter to decide
# regarding where to record them in changelog or if to skip them.
#
# The repository labels will be automatically configured using this file and
# the GitHub Action https://github.com/marketplace/actions/github-labeler.
- name: breaking
description: Breaking Changes
color: bfd4f2
- name: bug
description: Something isn't working
color: d73a4a
- name: build
description: Build System and Dependencies
color: bfdadc
- name: ci
description: Continuous Integration
color: 4a97d6
- name: dependencies
description: Pull requests that update a dependency file
color: 0366d6
- name: documentation
description: Improvements or additions to documentation
color: 0075ca
- name: duplicate
description: This issue or pull request already exists
color: cfd3d7
- name: enhancement
description: New feature or request
color: a2eeef
- name: github_actions
description: Pull requests that update Github_actions code
color: "000000"
- name: good first issue
description: Good for newcomers
color: 7057ff
- name: help wanted
description: Extra attention is needed
color: 008672
- name: invalid
description: This doesn't seem right
color: e4e669
- name: performance
description: Performance
color: "016175"
- name: python
description: Pull requests that update Python code
color: 2b67c6
- name: question
description: Further information is requested
color: d876e3
- name: refactoring
description: Refactoring
color: ef67c4
- name: removal
description: Removals and Deprecations
color: 9ae7ea
- name: style
description: Style
color: c120e5
- name: testing
description: Testing
color: b1fc6f
- name: wontfix
description: This will not be worked on
color: ffffff
29 changes: 29 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
categories:
- title: ":boom: Breaking Changes"
label: "breaking"
- title: ":rocket: Features"
label: "enhancement"
- title: ":fire: Removals and Deprecations"
label: "removal"
- title: ":beetle: Fixes"
label: "bug"
- title: ":racehorse: Performance"
label: "performance"
- title: ":rotating_light: Testing"
label: "testing"
- title: ":construction_worker: Continuous Integration"
label: "ci"
- title: ":books: Documentation"
label: "documentation"
- title: ":hammer: Refactoring"
label: "refactoring"
- title: ":lipstick: Style"
label: "style"
- title: ":package: Dependencies"
labels:
- "dependencies"
- "build"
template: |
## Changes
$CHANGES
9 changes: 9 additions & 0 deletions .github/workflows/constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
pip==24.0
pipx==1.5.0
nox==2024.4.15
nox-poetry==1.0.3
poetry==1.8.3
poetry-plugin-export==1.8.0
pytest==8.2.1
pytest-cov==5.0.0
pytest-django==4.8.0
19 changes: 19 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Labeler

on:
push:
branches:
- main
- master

jobs:
labeler:
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Run Labeler
uses: crazy-max/ghaction-github-labeler@v5.0.0
with:
skip-delete: true
78 changes: 78 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Release

on:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Set up Python
uses: actions/setup-python@v5.1.0
with:
python-version: "3.12"

- name: Upgrade pip
run: |
pip install --constraint=.github/workflows/constraints.txt pip
pip --version
- name: Install Poetry
run: |
pip install --constraint=.github/workflows/constraints.txt poetry
poetry --version
- name: Check if there is a parent commit
id: check-parent-commit
run: |
echo "::set-output name=sha::$(git rev-parse --verify --quiet HEAD^)"
- name: Detect and tag new version
id: check-version
if: steps.check-parent-commit.outputs.sha
uses: salsify/action-detect-and-tag-new-version@v2.0.3
with:
version-command: |
bash -o pipefail -c "poetry version | awk '{ print \$2 }'"
- name: Bump version for developmental release
if: "! steps.check-version.outputs.tag"
run: |
poetry version patch &&
version=$(poetry version | awk '{ print $2 }') &&
poetry version $version.dev.$(date +%s)
- name: Build package
run: |
poetry build --ansi
- name: Publish package on PyPI
if: steps.check-version.outputs.tag
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}

- name: Publish package on TestPyPI
if: "! steps.check-version.outputs.tag"
uses: pypa/gh-action-pypi-publish@v1.8.14
with:
user: __token__
password: ${{ secrets.TEST_PYPI_TOKEN }}
repository-url: https://test.pypi.org/legacy/

- name: Publish the release notes
uses: release-drafter/release-drafter@v6.0.0
with:
publish: ${{ steps.check-version.outputs.tag != '' }}
tag: ${{ steps.check-version.outputs.tag }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50 changes: 50 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Tests
on: [push, pull_request]

jobs:
tests:
env:
FORCE_COLOR: "1"
PRE_COMMIT_COLOR: "always"

strategy:
fail-fast: false

name: "Integration testing"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: "Set up environment"
run: |
docker compose build --build-arg MULTIPLE_PYTHON=True
docker compose up -d
- name: "Wait for docker to finish building"
run: sleep 10

- name: "Run tests"
run: docker compose exec django_test nox -r --force-color

- name: Upload documentation
uses: actions/upload-artifact@v4
with:
name: docs
path: docs/_build

- name: Combine coverage data and display human readable report
run: |
docker compose exec django_test nox --session "coverage(django='5.0')"
- name: Create coverage report and copy to artifacts
run: |
docker compose exec django_test nox --session "coverage(django='5.0')" -- xml
docker compose exec django_test cat coverage.xml > coverage.xml
- name: Upload coverage report
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: "Shut down environment"
run: docker compose down
Loading

0 comments on commit e04a774

Please sign in to comment.