Skip to content

Commit

Permalink
Merge pull request #15 from kggx/kggx/issue2
Browse files Browse the repository at this point in the history
Closes #2
  • Loading branch information
kggx authored May 18, 2024
2 parents b3a963f + 7f6f179 commit 070c9ed
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 38 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ on:
- published
env:
version_path: / # Path for docs. Default is latest

permissions:
contents: write

jobs:
#####################################
# Build and publish the documentation
Expand All @@ -32,11 +32,12 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: "3.12"

- name: Install dev module and requirements
run: pip install -r requirements-dev.txt

run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Build documentation HTML
run: pdoc ./src/pyventim -o ./docs
Expand All @@ -49,5 +50,5 @@ jobs:
branch: gh-pages
folder: docs/
target-folder: ${{ env.version_path }}
clean: true
clean: true
clean-exclude: '["version"]'
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Upload Python Package to PyPI

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- 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: python -m build

- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
60 changes: 32 additions & 28 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -1,43 +1,47 @@

name: Tests
on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]
workflow_dispatch:

jobs:
##########################
##################################
# Lint and test the Python package
##########################
##################################
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ "3.10", "3.11", "3.12" ]
python-version: ["3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest requests
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest -v
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest -v --cov
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
token: ${{ secrets.GH_CODECOV_TOKEN_PYVENTIM }}
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
[![Testing](https://github.com/kggx/pyventim/actions/workflows/testing.yml/badge.svg?branch=main)](https://github.com/kggx/pyventim/actions/workflows/testing.yml)
[![Documentation](https://github.com/kggx/pyventim/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/kggx/pyventim/actions/workflows/docs.yml)
[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](code_of_conduct.md)
[![PyPI Latest Release](https://img.shields.io/pypi/v/pyventim.svg)](https://pypi.org/project/pyventim/)
[![PyPI Downloads](https://img.shields.io/pypi/dm/pyventim.svg?label=PyPI%20downloads)](https://pypi.org/project/pyventim/)
[![Coverage](https://codecov.io/github/kggx/pyventim/coverage.svg?branch=main)](https://app.codecov.io/github/kggx/pyventim)

---

> [!NOTE]
> Consider the whole project as unstable until version 1.0.0 is reached.
# pyventim

A Python module to fetch usable data with a reverse engineered Eventim API.

## Description

An in-depth paragraph about your project and overview of use.
The [Eventim](https://www.eventim.com/) API has some public endpoints but also hidden data in the HTML responses. The project goal is to provide away to fetch this data with simple to use python objecs.

> [!IMPORTANT]
> Be aware that the APIs of Eventim can change without notice and therefore break the module.
## Getting Started

Expand Down
4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ dynamic = ["dependencies", "optional-dependencies"]

requires-python = ">=3.10"
classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
]
Expand Down
4 changes: 4 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Main module
requests >= 2.31.0

# Development tooling
flake8 >= 7.0.0
pytest-cov >= 5.0.0
pytest >= 8.2.0
black >= 24.4.0
pdoc >= 14.4.0
Expand Down
4 changes: 3 additions & 1 deletion shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ pkgs.mkShell {
# Python 3.12 + packages
(pkgs.python312.withPackages (python-pkgs: [
python-pkgs.requests
python-pkgs.pytest
python-pkgs.black
python-pkgs.pdoc
python-pkgs.twine
python-pkgs.build
python-pkgs.pytest
python-pkgs.pytest-cov
python-pkgs.flake8
]))
];
}

0 comments on commit 070c9ed

Please sign in to comment.