-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Release v0.3.0: Migrate essential logic to V9 (#68)
* Allow to fetch, update, change password, manage preferences and fetch features list for CurrentUser * Allow to fetch and list Workspaces * Allow to fetch, create, update, bulk edit, delete and stop TimeEntry * Implement searching for ReportTimeEntries * Allow to fetch and list Projects * Add integration tests, pytest and nox tests * Setup GitHub actions for pr check and publishing package on Test Pypi * Add pre-commit with pre-commit.ci * Update dependencies * Update README and ReadTheDocs documentation * Add Ruff with adopted company guidelines * Change authors to company, add maintainer * Remove irrelevant config options, set line length to 100 * Change LICENSE owner to company
- Loading branch information
Showing
57 changed files
with
4,206 additions
and
1,667 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
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,73 @@ | ||
name: pr | ||
|
||
on: | ||
- pull_request | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
checks: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
PYTHON_VERSION: "3.8" | ||
POETRY_VERSION: "1.8.3" | ||
RUFF_VERSION: "0.6.7" | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Install python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install --upgrade pip | ||
pip install ruff==${{ env.RUFF_VERSION }} | ||
- name: Run Ruff | ||
run: ruff check --output-format=github . | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
cache: 'pip' | ||
|
||
- name: Install Poetry | ||
run: pip install poetry==${{ env.POETRY_VERSION }} | ||
|
||
- name: Restore dependencies from cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pypoetry | ||
key: dependencies-cache-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }} | ||
restore-keys: | | ||
dependencies-cache-${{ runner.os }}-${{ env.PYTHON_VERSION }}- | ||
- name: Install dependencies | ||
if: steps.setup-python.outputs.cache-hit != 'true' | ||
run: | | ||
poetry config virtualenvs.create false | ||
poetry install --no-root --no-interaction | ||
- name: Run Pytest on Python ${{ matrix.python }} | ||
run: poetry run pytest -m "not integration" |
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,60 @@ | ||
name: Upload Python Package | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
PYTHON_VERSION: "3.8" | ||
POETRY_CORE_VERSION: "1.9.0" | ||
|
||
jobs: | ||
release-build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Build release distributions | ||
run: | | ||
python -m pip install build poetry-core==${{ env.POETRY_CORE_VERSION }} | ||
python -m build | ||
- name: Upload distributions | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
|
||
pypi-publish: | ||
runs-on: ubuntu-latest | ||
|
||
needs: | ||
- release-build | ||
|
||
permissions: | ||
# IMPORTANT: this permission is mandatory for trusted publishing | ||
id-token: write | ||
|
||
environment: | ||
name: test_pypi | ||
url: https://test.pypi.org/p/toggl_python | ||
|
||
steps: | ||
- name: Retrieve release distributions | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: release-dists | ||
path: dist/ | ||
|
||
- name: Publish release distributions to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ |
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
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 |
---|---|---|
@@ -1,17 +1,43 @@ | ||
default_language_version: | ||
python: python3.8 | ||
|
||
default_install_hook_types: | ||
- pre-commit | ||
- pre-push | ||
|
||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- id: mixed-line-ending | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.6.7 | ||
hooks: | ||
- id: ruff | ||
args: [ --fix ] | ||
# Spell Checker | ||
- repo: https://github.com/crate-ci/typos | ||
rev: v1.24.6 | ||
hooks: | ||
- id: typos | ||
# Git commit linter | ||
- repo: https://github.com/jorisroovers/gitlint | ||
rev: v0.19.1 | ||
hooks: | ||
- id: gitlint | ||
# Detect hardcoded secrets | ||
- repo: https://github.com/zricethezav/gitleaks | ||
rev: v8.19.2 | ||
hooks: | ||
- id: gitleaks | ||
- repo: local | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: poetry run black . | ||
language: python | ||
types: [python] | ||
|
||
- id: isort | ||
name: isort | ||
entry: poetry run isort . | ||
- id: test | ||
name: test | ||
entry: poetry run nox | ||
pass_filenames: false | ||
stages: [pre-push] | ||
language: python | ||
types: [python] |
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
Oops, something went wrong.