Skip to content

Commit c8c0f74

Browse files
authored
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
1 parent 12f8b0c commit c8c0f74

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+4206
-1667
lines changed

.editorconfig

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,15 @@ root = true
33
[Makefile]
44
indent_style = tab
55

6-
[*.{html,py,js,yml}]
6+
[*.{py,yml}]
77
charset = utf-8
88

9-
[*.js]
10-
indent_style = space
11-
indent_size = 2
12-
139
[*.yml]
1410
indent_style = space
1511
indent_size = 2
1612

17-
[*.html]
18-
indent_style = space
19-
indent_size = 4
20-
2113
[*.py]
2214
indent_style = space
2315
indent_size = 4
24-
line_length = 79
16+
line_length = 100
2517
multi_line_output = 3

.github/workflows/pr.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: pr
2+
3+
on:
4+
- pull_request
5+
6+
permissions:
7+
contents: read
8+
pull-requests: read
9+
checks: write
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
PYTHON_VERSION: "3.8"
17+
POETRY_VERSION: "1.8.3"
18+
RUFF_VERSION: "0.6.7"
19+
20+
jobs:
21+
lint:
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 10
24+
steps:
25+
- uses: actions/checkout@v4
26+
27+
- name: Install python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: ${{ env.PYTHON_VERSION }}
31+
32+
- name: Install dependencies
33+
run: |
34+
pip install --upgrade pip
35+
pip install ruff==${{ env.RUFF_VERSION }}
36+
37+
- name: Run Ruff
38+
run: ruff check --output-format=github .
39+
40+
test:
41+
runs-on: ubuntu-latest
42+
strategy:
43+
matrix:
44+
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
45+
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Setup Python
50+
uses: actions/setup-python@v5
51+
with:
52+
python-version: ${{ matrix.python }}
53+
cache: 'pip'
54+
55+
- name: Install Poetry
56+
run: pip install poetry==${{ env.POETRY_VERSION }}
57+
58+
- name: Restore dependencies from cache
59+
uses: actions/cache@v4
60+
with:
61+
path: ~/.cache/pypoetry
62+
key: dependencies-cache-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ env.POETRY_VERSION }}
63+
restore-keys: |
64+
dependencies-cache-${{ runner.os }}-${{ env.PYTHON_VERSION }}-
65+
66+
- name: Install dependencies
67+
if: steps.setup-python.outputs.cache-hit != 'true'
68+
run: |
69+
poetry config virtualenvs.create false
70+
poetry install --no-root --no-interaction
71+
72+
- name: Run Pytest on Python ${{ matrix.python }}
73+
run: poetry run pytest -m "not integration"

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Upload Python Package
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
permissions:
8+
contents: read
9+
10+
env:
11+
PYTHON_VERSION: "3.8"
12+
POETRY_CORE_VERSION: "1.9.0"
13+
14+
jobs:
15+
release-build:
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ env.PYTHON_VERSION }}
24+
25+
- name: Build release distributions
26+
run: |
27+
python -m pip install build poetry-core==${{ env.POETRY_CORE_VERSION }}
28+
python -m build
29+
30+
- name: Upload distributions
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: release-dists
34+
path: dist/
35+
36+
pypi-publish:
37+
runs-on: ubuntu-latest
38+
39+
needs:
40+
- release-build
41+
42+
permissions:
43+
# IMPORTANT: this permission is mandatory for trusted publishing
44+
id-token: write
45+
46+
environment:
47+
name: test_pypi
48+
url: https://test.pypi.org/p/toggl_python
49+
50+
steps:
51+
- name: Retrieve release distributions
52+
uses: actions/download-artifact@v4
53+
with:
54+
name: release-dists
55+
path: dist/
56+
57+
- name: Publish release distributions to PyPI
58+
uses: pypa/gh-action-pypi-publish@release/v1
59+
with:
60+
repository-url: https://test.pypi.org/legacy/

.gitignore

Lines changed: 3 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,39 +47,9 @@ coverage.xml
4747
.hypothesis/
4848
.pytest_cache/
4949

50-
# Translations
51-
*.mo
52-
*.pot
53-
54-
# Django stuff:
55-
*.log
56-
local_settings.py
57-
58-
# Flask stuff:
59-
instance/
60-
.webassets-cache
61-
62-
# Scrapy stuff:
63-
.scrapy
64-
65-
# Sphinx documentation
66-
docs/_build/
67-
68-
# PyBuilder
69-
target/
70-
71-
# Jupyter Notebook
72-
.ipynb_checkpoints
73-
7450
# pyenv
7551
.python-version
7652

77-
# celery beat schedule file
78-
celerybeat-schedule
79-
80-
# SageMath parsed files
81-
*.sage.py
82-
8353
# dotenv
8454
.env
8555

@@ -88,23 +58,13 @@ celerybeat-schedule
8858
venv/
8959
ENV/
9060

91-
# Spyder project settings
92-
.spyderproject
93-
.spyproject
94-
95-
# Rope project settings
96-
.ropeproject
97-
98-
# mkdocs documentation
99-
/site
100-
10161
# mypy
10262
.mypy_cache/
10363

64+
.ruff_cache
65+
10466
# IDE settings
10567
.vscode/
10668
local_*.py
10769
.idea/
108-
109-
# readthedocs sphinx generated documentation
110-
_build/
70+
pyrightconfig.json

.pre-commit-config.yaml

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,43 @@
11
default_language_version:
22
python: python3.8
33

4+
default_install_hook_types:
5+
- pre-commit
6+
- pre-push
7+
48
repos:
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: v4.6.0
11+
hooks:
12+
- id: end-of-file-fixer
13+
- id: trailing-whitespace
14+
- id: mixed-line-ending
15+
- repo: https://github.com/astral-sh/ruff-pre-commit
16+
rev: v0.6.7
17+
hooks:
18+
- id: ruff
19+
args: [ --fix ]
20+
# Spell Checker
21+
- repo: https://github.com/crate-ci/typos
22+
rev: v1.24.6
23+
hooks:
24+
- id: typos
25+
# Git commit linter
26+
- repo: https://github.com/jorisroovers/gitlint
27+
rev: v0.19.1
28+
hooks:
29+
- id: gitlint
30+
# Detect hardcoded secrets
31+
- repo: https://github.com/zricethezav/gitleaks
32+
rev: v8.19.2
33+
hooks:
34+
- id: gitleaks
535
- repo: local
636
hooks:
7-
- id: black
8-
name: black
9-
entry: poetry run black .
10-
language: python
11-
types: [python]
12-
13-
- id: isort
14-
name: isort
15-
entry: poetry run isort .
37+
- id: test
38+
name: test
39+
entry: poetry run nox
40+
pass_filenames: false
41+
stages: [pre-push]
1642
language: python
1743
types: [python]

LICENSE

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020, Ivlev Denis
3+
Copyright (c) 2024, Evrone.com Inc
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2121
SOFTWARE.
22-

0 commit comments

Comments
 (0)