Skip to content

Commit

Permalink
confirming to new comberload
Browse files Browse the repository at this point in the history
  • Loading branch information
ken-morel committed Jul 24, 2024
1 parent 4d0ed44 commit 4d77165
Show file tree
Hide file tree
Showing 37 changed files with 380 additions and 214 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/.*
!**/.flake8
!**/.coveragerc

**/__pycache__
46 changes: 46 additions & 0 deletions .github/workflows/pyre.yml.un
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'
45 changes: 45 additions & 0 deletions .github/workflows/python-publish.yml
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
58 changes: 58 additions & 0 deletions .github/workflows/test.yml
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: ''
7 changes: 7 additions & 0 deletions LICENSE
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.
24 changes: 24 additions & 0 deletions Makefile
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
51 changes: 51 additions & 0 deletions docker-compose.yml
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
9 changes: 9 additions & 0 deletions dockerfiles/dev.dockerfile
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 .
2 changes: 2 additions & 0 deletions src/.flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120
Binary file removed src/__pycache__/comberloa.cpython-311.pyc
Binary file not shown.
Binary file removed src/__pycache__/comberload.cpython-311.pyc
Binary file not shown.
126 changes: 0 additions & 126 deletions src/comberload.py

This file was deleted.

Loading

0 comments on commit 4d77165

Please sign in to comment.