Skip to content

Commit 79cbdd9

Browse files
authored
Merge pull request #170 from lokalise/types
Update typing info
2 parents 18455d4 + 4d9fb69 commit 79cbdd9

File tree

211 files changed

+3773
-3022
lines changed

Some content is hidden

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

211 files changed

+3773
-3022
lines changed

.github/CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
3. Install the necessary dependencies using `uv sync` (please note that you'll also require [uv](https://github.com/astral-sh/uv) installed).
66
4. Implement your feature or bug fix.
77
5. Don't forget to add tests and make sure they pass by running `uv run pytest`. Tests will be linted automatically.
8-
6. Make sure your code complies with the style guide by running `uv run pylint lokalise/`. You can also auto-fix formatting issues with: `uv run autopep8 -i -r lokalise/ -a`
9-
7. We use type hinting so check if everything is okay by running `uv run mypy lokalise/`.
8+
6. Make sure your code complies with the style guide by running `uv run ruff check`. You can also auto-fix issues with: `uv run ruff check --fix` and `uv run black .`.
9+
7. We use type hinting so check if everything is okay by running `uv run pyright`.
1010
8. If necessary, add documentation for your feature or bug fix.
1111
9. Commit and push your changes.
1212
10. [Submit a pull request.][pr]

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
os: [ubuntu-latest]
18-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
18+
python-version: ['3.10', '3.11', '3.12', '3.13']
1919
steps:
2020
- uses: actions/checkout@v5
2121
- uses: actions/setup-python@v6

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ docs/_build
2222
.mypy_cache
2323
coverage.lcov
2424
.idea/
25+
.ruff_cache/

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Official Python 3 interface for the [Lokalise APIv2](https://developers.lokalise
1010

1111
## Quick start
1212

13-
This plugin requires Python 3.9 and above. Install it:
13+
This plugin requires Python 3.10 and above. Install it:
1414

1515
```
1616
pip install python-lokalise-api
@@ -20,7 +20,9 @@ Obtain a Lokalise API token (in your *Personal profile*) and use it:
2020

2121
```python
2222
import lokalise
23+
2324
client = lokalise.Client('YOUR_API_TOKEN')
25+
2426
project = client.project('123.abc')
2527
print(project.name)
2628

docs/additional_info/changelog.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
Changelog
44
=========
55

6+
4.0.0 (28-Sep-2025)
7+
-------------------
8+
9+
* Require Python 3.10+
10+
* Fully rework typing system
11+
* Make code more solid, enhance error handling
12+
* Switch to uv, black, ruff
13+
614
3.5.1 (14-May-2025)
715
-------------------
816

docs/additional_info/exception_handling.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To handle an exception you would do the following:
3030
client.project('invalid_id')
3131
except lokalise.errors.NotFound as err:
3232
print(err.message)
33-
print(err.code)
33+
print(err.status_code)
3434
3535
Rate limits
3636
-----------

docs/api/getting_started.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Getting started
66
Installation and requirements
77
-----------------------------
88

9-
This plugin requires `Python 3.9 <http://www.python.org/>`_ or above and `PIP <https://pypi.org/project/pip/>`_.
9+
This plugin requires `Python 3.10 <http://www.python.org/>`_ or above and `PIP <https://pypi.org/project/pip/>`_.
1010

1111
Install it by running:
1212

docs/conf.py

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,60 +12,60 @@
1212
#
1313
import os
1414
import sys
15-
sys.path.insert(0, os.path.abspath('..'))
15+
16+
sys.path.insert(0, os.path.abspath(".."))
1617
from lokalise._version import __version__
1718

1819
# -- Project information -----------------------------------------------------
19-
project = 'python-lokalise-api'
20-
copyright = '2023, Lokalise group, Ilya Krukowski'
21-
author = 'Lokalise group, Ilya Krukowski'
20+
project = "python-lokalise-api"
21+
copyright = "2023, Lokalise group, Ilya Krukowski"
22+
author = "Lokalise group, Ilya Krukowski"
2223

2324
# The full version, including alpha/beta/rc tags
2425
release = __version__
2526
version = __version__
2627

2728
# -- General configuration ---------------------------------------------------
28-
master_doc = 'index'
29+
master_doc = "index"
2930

3031
# Add any Sphinx extension module names here, as strings. They can be
3132
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3233
# ones.
33-
extensions = [
34-
]
34+
extensions = []
3535

3636
# Add any paths that contain templates here, relative to this directory.
37-
templates_path = ['_templates']
37+
templates_path = ["_templates"]
3838

3939
# List of patterns, relative to source directory, that match files and
4040
# directories to ignore when looking for source files.
4141
# This pattern also affects html_static_path and html_extra_path.
42-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
42+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
4343

4444

4545
# -- Options for HTML output -------------------------------------------------
4646

4747
# The theme to use for HTML and HTML Help pages. See the documentation for
4848
# a list of builtin themes.
4949

50-
html_theme = 'alabaster'
50+
html_theme = "alabaster"
5151

5252
# Add any paths that contain custom static files (such as style sheets) here,
5353
# relative to this directory. They are copied after the builtin static files,
5454
# so a file named "default.css" will overwrite the builtin "default.css".
55-
html_static_path = ['_static']
55+
html_static_path = ["_static"]
5656

57-
html_title = 'Python Lokalise API client'
58-
html_short_title = 'Lokalise API client'
57+
html_title = "Python Lokalise API client"
58+
html_short_title = "Lokalise API client"
5959

6060
html_sidebars = {
6161
"index": [
62-
'about.html',
62+
"about.html",
6363
"globaltoc.html",
6464
"links.html",
6565
"slim_searchbox.html",
6666
],
6767
"**": [
68-
'about.html',
68+
"about.html",
6969
"globaltoc.html",
7070
"relations.html",
7171
"links.html",
@@ -74,9 +74,9 @@
7474
}
7575

7676
html_theme_options = {
77-
'logo': 'lok_logo.png',
78-
'github_user': 'lokalise',
79-
'github_repo': 'python-lokalise-api',
80-
'github_button': 'true',
81-
'show_powered_by': 'false'
77+
"logo": "lok_logo.png",
78+
"github_user": "lokalise",
79+
"github_repo": "python-lokalise-api",
80+
"github_button": "true",
81+
"show_powered_by": "false",
8282
}

lokalise/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
:license: BSD 3 Clause License, see LICENSE for more details.
77
"""
88

9+
from . import errors as errors
910
from .client import Client
10-
from .oauth_client import OAuthClient
1111
from .oauth2.auth import Auth
12+
from .oauth_client import OAuthClient
13+
14+
__all__ = ["Client", "Auth", "OAuthClient", "errors"]

lokalise/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
This module contains plugin metadata.
55
"""
66

7-
__version__: str = "3.5.1"
7+
__version__: str = "4.0.0"

0 commit comments

Comments
 (0)