Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.3.0: Migrate essential logic to V9 #68

Merged
merged 27 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
f3b8112
Clear irrelevant ignores, add Pyright LSP config ignore
nifadyev Jul 19, 2024
26eea39
Change authors to company, add maintainer
nifadyev Jul 19, 2024
2c775c4
Add missing Python versions in supported versions list, set 3.8 as ta…
nifadyev Jul 19, 2024
4cc8822
Update build system
nifadyev Jul 19, 2024
8e78a8c
Remove all dependencies
nifadyev Jul 19, 2024
76c7844
Delete old implementation with tests
nifadyev Jul 19, 2024
79491bf
Remove irrelevant config options, set line length to 100
nifadyev Jul 19, 2024
dfbfa0d
Change LICENSE owner to company
nifadyev Jul 19, 2024
d1db0ee
Add basic and token auth with logged endpoint (#38)
nifadyev Jul 22, 2024
b32f3fc
Setup pytest and nox, add tests for /me/logged (#40)
nifadyev Jul 22, 2024
8975411
Add Ruff with adopted company styleguide (#43)
nifadyev Jul 23, 2024
b0122fc
Add pre-commit with pre-commit.ci (#44)
nifadyev Jul 23, 2024
d4d9aba
Add fetching and updating CurrentUser (#48)
nifadyev Jul 26, 2024
d7f075e
Allow to change user's password, manage preferences and fetch feature…
nifadyev Jul 29, 2024
af1986a
#35: Setup GitHub actions for pr (#51)
nifadyev Aug 22, 2024
0b4e8a3
#53: Allow to fetch and list Workspaces (#54)
nifadyev Aug 30, 2024
c4042ae
#8: Implement TimeEntry entities fetching (#52)
nifadyev Aug 30, 2024
35e6008
#59: Add GitHub action to publish package on Test Pypi (#60)
nifadyev Aug 30, 2024
29f0d3d
#55: Implement searching for ReportTImeEntries (#57)
nifadyev Aug 30, 2024
80e38c1
Allow fetching and listing Projects (#61)
nifadyev Sep 2, 2024
3dcee3f
Allow to update, bulk edit, delete and stop TimeEntries (#62)
nifadyev Sep 3, 2024
10de087
#63: Add integration tests for User entity (#64)
nifadyev Sep 4, 2024
58637f1
#8: Allow to create TimeEntry (#66)
nifadyev Sep 16, 2024
1df3344
#65: Add integration tests for essential logic (#67)
nifadyev Sep 18, 2024
ce7c6ab
Update dependencies version (#70)
nifadyev Sep 19, 2024
174ac4f
Update README and ReadTheDocs documentation (#69)
nifadyev Sep 19, 2024
f200a7a
Minor changes after pre release review (#71)
nifadyev Sep 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,15 @@ root = true
[Makefile]
indent_style = tab

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

[*.js]
indent_style = space
indent_size = 2

[*.yml]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 4

[*.py]
indent_style = space
indent_size = 4
line_length = 79
line_length = 100
multi_line_output = 3
73 changes: 73 additions & 0 deletions .github/workflows/pr.yml
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"
60 changes: 60 additions & 0 deletions .github/workflows/release.yml
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/
46 changes: 3 additions & 43 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,39 +47,9 @@ coverage.xml
.hypothesis/
.pytest_cache/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# dotenv
.env

Expand All @@ -88,23 +58,13 @@ celerybeat-schedule
venv/
ENV/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/

.ruff_cache

# IDE settings
.vscode/
local_*.py
.idea/

# readthedocs sphinx generated documentation
_build/
pyrightconfig.json
44 changes: 35 additions & 9 deletions .pre-commit-config.yaml
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]
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020, Ivlev Denis
Copyright (c) 2024, Evrone.com Inc

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,3 @@ 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.

Loading