generated from ken-morel/pip-package-template-docker
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
37 changed files
with
380 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
**/.* | ||
!**/.flake8 | ||
!**/.coveragerc | ||
|
||
**/__pycache__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
# This workflow integrates Pyre with GitHub's | ||
# Code Scanning feature. | ||
# | ||
# Pyre is a performant type checker for Python compliant with | ||
# PEP 484. Pyre can analyze codebases with millions of lines | ||
# of code incrementally – providing instantaneous feedback | ||
# to developers as they write code. | ||
# | ||
# See https://pyre-check.org | ||
|
||
name: Pyre | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
pyre: | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
|
||
- name: Run Pyre | ||
uses: facebook/pyre-action@60697a7858f7cc8470d8cc494a3cf2ad6b06560d | ||
with: | ||
# To customize these inputs: | ||
# See https://github.com/facebook/pyre-action#inputs | ||
repo-directory: './src/' | ||
requirements-path: 'requirements.txt' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
defaults: | ||
run: | ||
working-directory: src | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: '3.12' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
- name: Build package | ||
run: | | ||
cp ../README.md ../LICENSE ./ | ||
python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
packages_dir: src/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | ||
|
||
name: Test | ||
|
||
on: | ||
- push | ||
|
||
defaults: | ||
run: | ||
working-directory: src | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: | ||
- "3.10" | ||
- "3.11" | ||
- "3.12" | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v3 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: | | ||
cp ../README.md ../LICENSE ./ | ||
python -m pip install --upgrade pip setuptools | ||
pip install -e .[ci] | ||
- name: Test with pytest | ||
run: | | ||
pytest --cov --cov-report term-missing:skip-covered | ||
- name: Upload to Coveralls | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
COVERALLS_FLAG_NAME: ${{ matrix.python-version }} | ||
COVERALLS_PARALLEL: true | ||
run: | | ||
coveralls --service=github | ||
coveralls: | ||
name: Indicate completion to coveralls.io | ||
needs: test | ||
runs-on: ubuntu-latest | ||
container: python:3-slim | ||
steps: | ||
- name: Finished | ||
run: | | ||
python -m pip install --upgrade coveralls | ||
coveralls --service=github --finish | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
working-directory: '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright 2024 ken-morel | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
build: | ||
docker-compose build --pull | ||
|
||
lint: | ||
docker-compose run --rm dev flake8 | ||
|
||
test: | ||
docker-compose run --rm dev pytest --cov --cov-report term-missing:skip-covered | ||
|
||
test38: | ||
docker-compose run --rm test38 | ||
test39: | ||
docker-compose run --rm test39 | ||
test310: | ||
docker-compose run --rm test310 | ||
test311: | ||
docker-compose run --rm test311 | ||
test312: | ||
docker-compose run --rm test312 | ||
|
||
ci: build lint test test38 test39 test310 test311 test312 | ||
|
||
sdist: | ||
docker-compose run --rm dev python setup.py sdist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
version: '3.8' | ||
|
||
services: | ||
dev: | ||
build: | ||
context: . | ||
dockerfile: dockerfiles/dev.dockerfile | ||
volumes: | ||
- ./src:/src | ||
- ./README.rst:/src/README.rst | ||
- ./LICENSE:/src/LICENSE | ||
|
||
test38: | ||
build: | ||
context: . | ||
dockerfile: dockerfiles/dev.dockerfile | ||
args: | ||
PYTHON_VERSION: '3.8' | ||
command: pytest | ||
|
||
test39: | ||
build: | ||
context: . | ||
dockerfile: dockerfiles/dev.dockerfile | ||
args: | ||
PYTHON_VERSION: '3.9' | ||
command: pytest | ||
|
||
test310: | ||
build: | ||
context: . | ||
dockerfile: dockerfiles/dev.dockerfile | ||
args: | ||
PYTHON_VERSION: '3.10' | ||
command: pytest | ||
|
||
test311: | ||
build: | ||
context: . | ||
dockerfile: dockerfiles/dev.dockerfile | ||
args: | ||
PYTHON_VERSION: '3.11' | ||
command: pytest | ||
|
||
test312: | ||
build: | ||
context: . | ||
dockerfile: dockerfiles/dev.dockerfile | ||
args: | ||
PYTHON_VERSION: '3.12' | ||
command: pytest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
ARG PYTHON_VERSION=3.12 | ||
FROM python:${PYTHON_VERSION} | ||
|
||
WORKDIR /src | ||
COPY src/setup.py README.md LICENSE ./ | ||
COPY src/shellsy/__init__.py ./shellsy/__init__.py | ||
RUN pip install -e .[dev] | ||
|
||
COPY src . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[flake8] | ||
max-line-length = 120 |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.