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

Add support for type annotations, typing.TypedDict and python dataclasses #167

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
53 changes: 13 additions & 40 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,47 +12,20 @@ on:

jobs:
tests:

runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']

steps:
- name: Checkout changes
uses: actions/checkout@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@main
with:
python-version: ${{ matrix.python-version }}
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
os: [ubuntu-latest, macos-latest, windows-latest]

- name: Use cache
id: cache-env
uses: actions/cache@v2
with:
path: env
key: ${{ runner.os }}-env-${{ matrix.python-version }}-${{ hashFiles('requirements.txt', 'requirements-tests.txt') }}

- name: Setup requirements
run: |
python -m venv env
env/bin/pip install -e .[tests]
if: steps.cache-env.outputs.cache-hit != 'true'

- name: Test with pytest
run: env/bin/pytest tests

notify:
runs-on: ubuntu-latest
needs: tests
steps:

- name: Notify Success
uses: archive/github-actions-slack@master
with:
slack-channel: C2CRL4C4V
slack-text: Tests are passed *[${{ github.repository }}] (${{ github.ref }})* https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
slack-bot-user-oauth-access-token: ${{ secrets.SLACK_BOT_TOKEN }}
slack-optional-as_user: false
slack-optional-icon_emoji: ":white_check_mark:"
- uses: actions/checkout@v4
- name: Setup PDM
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
cache: true
- name: Install dependencies
run: pdm install
- name: Run tests
run: pdm run pytest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
dist
docs/_build
.pytest_cache
.pdm-python
48 changes: 48 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py38-plus
- repo: https://github.com/hadialqattan/pycln
rev: v2.3.0
hooks:
- id: pycln
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/jvllmr/pyaphid
rev: v0.3.1
hooks:
- id: pyaphid
- repo: https://github.com/psf/black
rev: 23.11.0
hooks:
- id: black
- repo: https://github.com/asottile/yesqa
rev: v1.5.0
hooks:
- id: yesqa
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.5"
hooks:
- id: ruff
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
hooks:
- id: prettier
additional_dependencies: [prettier@latest, prettier-plugin-toml@latest]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.7.0"
hooks:
- id: mypy
exclude: ^tests/.*
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-toml
64 changes: 0 additions & 64 deletions .travis.yml

This file was deleted.

12 changes: 12 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"editor.formatOnSave": true,
"python.defaultInterpreterPath": ".venv/bin/python",
"python.terminal.activateEnvInCurrentTerminal": true,
"python.languageServer": "Pylance",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
},
"python.testing.pytestEnabled": true,
"python.analysis.inlayHints.functionReturnTypes": true,
"python.analysis.inlayHints.variableTypes": true
}
3 changes: 3 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2022-07-10
* Add support for type annotations, typing.TypedDict and dataclasses

2022-03-23
* Django: Support for UUIDField

Expand Down
6 changes: 5 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Copyright (c) 2013 by klen <[email protected]>.
All changes made by the fork are licensed by:
Copyright (c) 2013 by Jan Vollmer <[email protected]>.

Everything prior to the fork keeps the original license by:
Copyright (c) 2013 by klen <[email protected]>.

Some rights reserved.

Expand Down
Loading