Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: evrone/toggl-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.2.9
Choose a base ref
...
head repository: evrone/toggl-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
  • 13 commits
  • 64 files changed
  • 1 contributor

Commits on May 20, 2024

  1. Copy the full SHA
    12f8b0c View commit details

Commits on Sep 23, 2024

  1. 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
    nifadyev authored Sep 23, 2024
    Copy the full SHA
    c8c0f74 View commit details
  2. Copy the full SHA
    90fc20e View commit details

Commits on Sep 25, 2024

  1. Add Project fetching, creation, update and deletion (#74)

    * Move common factory to base file
    * Remove unavailable fields from request body on Project create/update
    * Add validation for Project timeframe and client_id and client_name
    nifadyev authored Sep 25, 2024
    Copy the full SHA
    dbd7e42 View commit details

Commits on Sep 27, 2024

  1. #77: Add projects bulk editing (#89)

    * Move Bulk Edit schemas and validation to base schemas
    * Fix invalid query param type for bulk edit operations
    nifadyev authored Sep 27, 2024
    Copy the full SHA
    7090337 View commit details
  2. Copy the full SHA
    17b0297 View commit details

Commits on Oct 4, 2024

  1. Copy the full SHA
    989fd51 View commit details

Commits on Oct 9, 2024

  1. #80: Add workspace updating (#92)

    * Remove deprecated fields from WorkspaceResponse schema
    * Remove check-pr-diff-size pre-commit hook
    nifadyev authored Oct 9, 2024
    Copy the full SHA
    5702052 View commit details

Commits on Oct 28, 2024

  1. Copy the full SHA
    3d7ac49 View commit details

Commits on Nov 6, 2024

  1. #94: Remove permissions field from response schemas (#95)

    * Change zoneinfo importing to fix type hints
    * Remove field email from PUT me integration test to avoid flaky test
    * Fix flaky project update test by removing check for old and new values inequality
    * Fix invalid timeframe format in Project's integration tests
    nifadyev authored Nov 6, 2024
    Copy the full SHA
    7ec536e View commit details
  2. Update version to 0.3.1

    nifadyev authored Nov 6, 2024
    Copy the full SHA
    bc0c44e View commit details

Commits on Jan 20, 2025

  1. #97: Add issue and pr templates (#98)

    * Add issue template
    * Add pull request template
    nifadyev authored Jan 20, 2025
    Copy the full SHA
    f1321fd View commit details

Commits on Jan 28, 2025

  1. #99: Remove extra fields from response schemas (#101)

    * Remove template and template_id from ProjectResponse schema
    * Use only active projects in integration tests
    * Disable change password integration test because it has crucial consequences
    * Remove only_admins_see_billable_rates, is_shared from Workspace response
    * Add note about creating venv for local development
    * Update nox version to support python 3.13
    * Fix test min boundary
    * Exclude init files from coverage report
    nifadyev authored Jan 28, 2025
    Copy the full SHA
    1c185f2 View commit details
Showing with 5,826 additions and 1,677 deletions.
  1. +2 −10 .editorconfig
  2. +25 −0 .github/ISSUE_TEMPLATE/bug.md
  3. +49 −0 .github/actions/large-pr-check/action.yaml
  4. +11 −0 .github/pull_request_template.md
  5. +89 −0 .github/workflows/pr.yml
  6. +56 −0 .github/workflows/release.yml
  7. +60 −0 .github/workflows/test_release.yml
  8. +3 −43 .gitignore
  9. +35 −9 .pre-commit-config.yaml
  10. +1 −2 LICENSE
  11. +119 −29 README.md
  12. +144 −30 docs/index.rst
  13. +0 −6 mypy.ini
  14. +14 −0 noxfile.py
  15. +448 −664 poetry.lock
  16. +94 −46 pyproject.toml
  17. +30 −0 scripts/large-pr-checker.sh
  18. +37 −18 tests/conftest.py
  19. 0 tests/factories/__init__.py
  20. +36 −0 tests/factories/base.py
  21. +80 −0 tests/factories/project.py
  22. +105 −0 tests/factories/time_entry.py
  23. +70 −0 tests/factories/workspace.py
  24. +0 −47 tests/fixtures.py
  25. +4 −0 tests/integration/__init__.py
  26. +59 −0 tests/integration/conftest.py
  27. +487 −0 tests/integration/test_project.py
  28. +82 −0 tests/integration/test_report_time_entry.py
  29. +135 −0 tests/integration/test_time_entry.py
  30. +192 −0 tests/integration/test_user.py
  31. +77 −0 tests/integration/test_workspace.py
  32. 0 tests/responses/__init__.py
  33. +128 −0 tests/responses/me_get.py
  34. +26 −0 tests/responses/me_put.py
  35. +37 −0 tests/responses/project_get.py
  36. +28 −0 tests/responses/report_time_entry_post.py
  37. +43 −0 tests/responses/time_entry_get.py
  38. +39 −0 tests/responses/workspace_get.py
  39. +0 −19 tests/test_api.py
  40. +0 −93 tests/test_entities.py
  41. +419 −0 tests/test_project.py
  42. +105 −0 tests/test_report_time_entry.py
  43. +0 −25 tests/test_repositories.py
  44. +533 −0 tests/test_time_entry.py
  45. +364 −0 tests/test_user.py
  46. +138 −0 tests/test_workspace.py
  47. +28 −56 toggl_python/__init__.py
  48. +21 −74 toggl_python/api.py
  49. +9 −10 toggl_python/auth.py
  50. +0 −150 toggl_python/entities.py
  51. 0 toggl_python/entities/__init__.py
  52. +61 −0 toggl_python/entities/report_time_entry.py
  53. +237 −0 toggl_python/entities/user.py
  54. +393 −0 toggl_python/entities/workspace.py
  55. +0 −46 toggl_python/exceptions.py
  56. +0 −269 toggl_python/repository.py
  57. +0 −31 toggl_python/response.py
  58. 0 toggl_python/schemas/__init__.py
  59. +87 −0 toggl_python/schemas/base.py
  60. +183 −0 toggl_python/schemas/current_user.py
  61. +128 −0 toggl_python/schemas/project.py
  62. +57 −0 toggl_python/schemas/report_time_entry.py
  63. +162 −0 toggl_python/schemas/time_entry.py
  64. +56 −0 toggl_python/schemas/workspace.py
12 changes: 2 additions & 10 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: Bug report
about: Report a problem and provide necessary context
title: 'Fix ...'
labels: 'bug'

---

<!--
Hi, thanks for submitting a bug. We appreciate that.
But, we will need some information about what's wrong to help you.
-->
## What's wrong

<!-- Describe what is not working. -->

## How it should work?

<!-- Describe how it should work. -->

## Checklist before calling for maintainers

* [ ] Have you checked to ensure there aren't other open [Issues](../issues) for the same problem?

49 changes: 49 additions & 0 deletions .github/actions/large-pr-check/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: "Large PR checker"
description: "Blocks PR if number of lines changed is excessive. Modified version of https://github.com/adolfosilva/gh-large-pr-check/blob/main/action.yml"

inputs:
max_lines_changed:
description: "Maximum number of lines changed allowed"
required: true
default: "500"
target_branch:
description: The branch to compare against
required: true
default: main
outputs:
total_lines_changed:
description: "Total lines changed in this PR"
value: ${{ steps.get_total_lines_changed.outputs.total_lines_changed }}

runs:
using: "composite"
steps:
- id: fetch_target_branch
run: |
git fetch origin ${{ inputs.target_branch }}
shell: bash
- id: get_total_lines_changed
run: |
size=$(git diff --shortstat origin/${{ inputs.target_branch }} ':(exclude)*.lock' \
| awk '{ print $4+$6 }' \
| awk -F- '{print $NF}' \
| bc)
echo ""
echo "Total lines changed (note: *.lock files are excluded from this count): $size"
echo "total_lines_changed=$size" >> $GITHUB_OUTPUT
shell: bash
- name: Comment PR
if: ${{ fromJSON(steps.get_total_lines_changed.outputs.total_lines_changed) > fromJSON(inputs.max_lines_changed) }}
uses: thollander/actions-comment-pull-request@v2
with:
comment_tag: pr_size
mode: recreate
message: |
:boom: :boom: :boom:
Total lines changed ${{ steps.get_total_lines_changed.outputs.total_lines_changed }} is greater than ${{ inputs.max_lines_changed }}.
Please consider breaking this PR down.
- id: fail
if: ${{ fromJSON(steps.get_total_lines_changed.outputs.total_lines_changed) > fromJSON(inputs.max_lines_changed) }}
run: exit 1
shell: bash
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## #(issue number): Summarize your changes

<!--Please include the reasons behind these changes and any relevant context.
This project only accepts pull requests related to open issues -->
<!--- Special phrase to auto-close the issue that your PR fixes -->
Closes # (issue number)

## Checklist before requesting a review

- [ ] Have you followed the guidelines in [CONTRIBUTING.md](../CONTRIBUTING.md)?
- [ ] Have you performed a self-review?
89 changes: 89 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
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:
check-pr-diff:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Check PR diff size
uses: ./.github/actions/large-pr-check
with:
target_branch: ${{ github.event.pull_request.base.ref }}
max_lines_changed: 300

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 .

- name: Spell Check
uses: crate-ci/typos@master

test:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13.0-rc.2"]

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"
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Manually Upload Python Package to Pypi

on: workflow_dispatch

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: pypi
url: https://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
60 changes: 60 additions & 0 deletions .github/workflows/test_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Upload Python Package to Test Pypi

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
@@ -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

@@ -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
Loading