Skip to content

Commit

Permalink
fix: refresh project support files
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen-RA-King committed May 31, 2022
1 parent dfbf190 commit 2940049
Show file tree
Hide file tree
Showing 50 changed files with 1,030 additions and 263 deletions.
5 changes: 5 additions & 0 deletions .bandit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
skips:
- B101 # Ignore defensive `assert`s (especially useful for mypy)
- B404 # Ignore warnings about importing subprocess
- B603 # Ignore warnings about calling subprocess.Popen without shell=True
- B607 # Ignore warnings about calling subprocess.Popen without a full path to executable
12 changes: 0 additions & 12 deletions .bumpversion.cfg

This file was deleted.

62 changes: 62 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
name: Bug report
about: Create a report to help us improve Black's quality
title: ""
labels: "T: bug"
assignees: ""
---

<!--
Please make sure that the bug is not already fixed either in newer versions or the
current development version. To confirm this, you have two options:
1. Update pynball version if a newer release exists: `pip install -U pynball`
2. Or run _pynball_ on your machine:
- create a new virtualenv (make sure it's the same Python version);
- clone this repository;
- run `pip install -e .[d]`;
- run `pip install -r requirements.txt`
- make sure it's sane by running `python -m pytest`; and
- run `pynball` like you did last time.
-->

**Describe the bug**

<!-- A clear and concise description of what the bug is. -->

**To Reproduce**

<!--
Minimal steps to reproduce the behavior with source code and pynball's configuration.
-->

For example, take this code:

```python
...
```

And run it with these arguments:

```sh
$
```

The resulting error is:

> ...
**Expected behavior**

<!-- A clear and concise description of what you expected to happen. -->

**Environment**

<!-- Please complete the following information: -->

- pynball's version: <!-- e.g. [main] -->
- OS and Python version: <!-- e.g. [Linux/Python 3.7.4rc1] -->

**Additional context**

<!-- Add any other context about the problem here. -->
21 changes: 21 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!-- Hello! Thanks for submitting a PR. To help make things go a bit more
smoothly we would appreciate that you go through this template. -->

### Description

<!-- Good things to put here include: reasoning for the change (please link
any relevant issues!) -->

### Checklist - did you ...

<!-- If any of the following items are not relevant for your contribution
please still tick them, so we know you've gone through the checklist.
All user-facing changes should get an entry. Otherwise, signal to me that
this should get the magical label to silence the CHANGELOG entry check.
Tests are required for bugfixes and new features. Documentation changes
are necessary for formatting and most enhancement changes. -->

- [ ] Add a CHANGELOG entry if necessary?
- [ ] Add / update tests if necessary?
- [ ] Add new / update outdated documentation?
File renamed without changes.
82 changes: 82 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# https://docs.github.com/en/actions
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: ci-cd

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
ci:
# Step 1. Set up operating system
runs-on: ubuntu-latest
steps:
# Step 2. Set up Python 3.9
- uses: actions/setup-python@v2
with:
python-version: 3.9
# Step 3. Check-out repository so we can access its contents
- uses: actions/checkout@v2
# Step 4. Install poetry
- uses: snok/install-poetry@v1
# Step 5. Install our pycounts package
- name: Install package
run: poetry install
# Step 6. Run tests for pycounts
- name: Test with pytest
run: poetry run pytest tests/ --cov=pycounts --cov-report=xml
# Step 7. Use Codecov to track coverage
- uses: codecov/codecov-action@v2
with:
file: ./coverage.xml # coverage report
fail_ci_if_error: true # terminate workflow if there's an error
# Step 8. Build documentation
- name: Build documentation
run: poetry run make html --directory docs/
cd:
# Only run this job if the "ci" job passes
needs: ci
# Only run this job if new work is pushed to "main"
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
# Step 1. Set up operating system
runs-on: ubuntu-latest
steps:
# Step 2. Set up Python 3.9
- uses: actions/setup-python@v2
with:
python-version: 3.9
# Step 3. Check-out repository so we can access its contents
- uses: actions/checkout@v2
with:
fetch-depth: 0
# Step 4. Use PSR to make release
- name: Python Semantic Release
run: |
pip install python-semantic-release
git config user.name github-actions
git config user.email github-actions@github.com
semantic-release publish
# Step 5. Publish to TestPyPI
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
# Step 6. Test install from TestPyPI
- name: Test install from TestPyPI
run: |
pip install \
--index-url https://test.pypi.org/simple/ \
--extra-index-url https://pypi.org/simple \
pycounts
# Step 7. Publish to PyPI
- uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
77 changes: 49 additions & 28 deletions .gitmessage
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,52 @@
# Wrap at 72 chars. ################################## which is here: #


# At the end: Include Co-authored-by for all contributors.
# Include at least one empty line before it. Format:
# Co-authored-by: name <user@users.noreply.github.com>
#
#
# 1.Separate subject from body with a blank line
# 2. Limit the subject line to 50 characters
# 3. Capitalize the subject line
# 4. Do not end the subject line with a period
# 5. Use the imperative mood in the subject line
# 6. Wrap the body at 72 characters
# 7. Use the body to explain what and why vs. how
#
# Commitizen:
# build:
# ci:
# docs: update to documentation
# feat: used when a new feature is added to your application
# fix: bug fix for your application
# perf:
# refactor:
# style:
# test:
# chore:
# revert:
# bump:
#
# xxxxx (scope)!: MUST consist of a noun describing a section of the codebase
# Commitizen and Python Semantic Release require the following:
# ------------------------------------------------------------
# Each commit message consists of a header, a body and a footer.
# The header has a special format that includes a type, a scope and a subject:

# <type>(<scope>): <subject>
# <BLANK LINE>
# <body>
# <BLANK LINE>
# <footer>

# The header is mandatory and the scope of the header is optional.

# - Revert -
# If the commit reverts a previous commit, it should begin with revert: , followed by
# the header of the reverted commit. In the body it should say: This reverts
# commit <hash>., where the hash is the SHA of the commit being reverted.

# - Type -
# feat: A new feature
# fix: A bug fix
# docs: Documentation only changes
# style: Changes that do not affect the meaning of the code (white-space, formatting..)
# refactor: A code change that neither fixes a bug nor adds a feature
# perf: A code change that improves performance
# test: Adding missing or correcting existing tests
# chore: Changes to the build process or auxiliary tools and libraries etc.

# - Scope -
# The scope could be anything specifying place of the commit change.
# You can use * when the change affects more than a single scope.

# - Subject -
# contains succinct description of the change:
# use the imperative, present tense: "change" not "changed" nor "changes"
# don't capitalize first letter
# no dot (.) at the end

# - Body -
# Just as in the subject, use the imperative, present tense: "change" not "changed" nor
# "changes". The body should include the motivation for the change and contrast this with
# previous behavior.

# - Footer -
# The footer should contain any information about Breaking Changes and is also the
# place to reference issues that this commit closes.
# e.g. Closes #123, #245, #992
# Breaking Changes should start with the word BREAKING CHANGE: with a space or two
# newlines. The rest of the commit message is then used for this.
31 changes: 26 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
rev: v4.2.0
hooks:
- id: check-ast
- id: check-added-large-files
Expand All @@ -20,6 +20,12 @@ repos:
- id: requirements-txt-fixer
- id: trailing-whitespace

- repo: https://github.com/commitizen-tools/commitizen
rev: v2.27.1
hooks:
- id: commitizen
stages: [commit-msg]

- repo: https://github.com/MartinThoma/check-pip-compile
rev: 0.1.1
hooks:
Expand All @@ -39,7 +45,7 @@ repos:
args: ["--filter-files"]

- repo: https://github.com/psf/black
rev: 22.1.0
rev: 22.3.0
hooks:
- id: black

Expand All @@ -55,21 +61,36 @@ repos:
args: ["--ignore=E800,F842,F841,W503"]

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
rev: v2.32.1
hooks:
- id: pyupgrade
args: [--py39]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v2.6.0
rev: v2.6.2
hooks:
- id: prettier
stages: [commit]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.960
hooks:
- id: mypy
args: [--ignore-missing-imports, --disallow-untyped-defs]
exclude: |
(?x)^(
docs/source/conf.py|
cleanup.py
)$
additional_dependencies:
- types-dataclasses >= 0.1.3
- lxml
- types-click

- repo: https://github.com/PyCQA/bandit
rev: 1.7.4
hooks:
- id: bandit
args:
- -s
- B404,B603,B101
- B101,B404,B603,B607
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CHANGELOG.md
11 changes: 8 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
sphinx:
configuration: docs/source/conf.py
formats: all

# Image to use
build:
image: testing

# Configuration
python:
version: 3.9
install:
- requirements: docs/requirements.txt
- method: pip
Expand Down
8 changes: 3 additions & 5 deletions AUTHORS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
Credits
---
# Credits

# Development Lead
## Development Lead

- Stephen R A King \<stephen.ra.king@gmail.com\>

# Maintainer
## Maintainer

- Stephen R A King \<stephen.ra.king@gmail.com\>
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Changelog

<!--next-version-placeholder-->

## 1.0.2 (2022-05-31)

### First Release of 'pynball'



<!-- Markdown link & img dfn's -->

[github](https://github.com/Stephen-RA-King/pynball)
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM python:3.9-alpine
WORKDIR /apps/pynball/
COPY src/pynball/. .
COPY requirements/development.txt .
RUN ["pip", "install", "-r", "development.txt"]
CMD ["python", "pynball.py"]
Loading

0 comments on commit 2940049

Please sign in to comment.