Skip to content

Commit

Permalink
Add pytypes in vendor directory
Browse files Browse the repository at this point in the history
Using:

```
pytypes @ git+ssh://git@github.com/Stewori/pytypes@b7271ec654d3553894febc6e0d8ad1b0e1ac570a
```

in `install_requires` forbid the package to be
correctly installed.

So we vendored the `pytypes` package waiting for
an official package version supporting python 3.7+
  • Loading branch information
twidi committed Jun 23, 2020
1 parent 64c45e9 commit b2e6f39
Show file tree
Hide file tree
Showing 15 changed files with 7,475 additions and 12 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ references:
- run:
name: Check every commits
command: |
mkdir ~/.ssh/ && echo -e "Host github.com\n\tStrictHostKeyChecking no\n" > ~/.ssh/config
source ~/venv/bin/activate
.circleci/check-every-commit.sh
Expand Down
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Add files or directories to the blacklist. They should be base names, not
# paths.
ignore=codec
ignore=codec,vendor

# Pickle collected data for later comparisons.
persistent=yes
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ mypy: ## Run the mypy tool
.PHONY: check-isort
check-isort: ## Run the isort tool in check mode only (won't modify files)
@echo "$(BOLD)Checking isort(RESET)"
@isort --check-only `find src/ -name '*.py' | grep -v '/codec/' | xargs grep -L '# coding: mixt'` 2>&1
@isort --check-only `find src/ -name '*.py' | grep -v '/codec\|vendor/' | xargs grep -L '# coding: mixt'` 2>&1

.PHONY: check-black
check-black: ## Run the black tool in check mode only (won't modify files)
@echo "$(BOLD)Checking black$(RESET)"
@black --check `find src/ -name '*.py' | grep -v '/codec/' | xargs grep -L '# coding: mixt'` 2>&1
@black --check `find src/ -name '*.py' | grep -v '/codec\|vendor/' | xargs grep -L '# coding: mixt'` 2>&1

.PHONY: flake8
flake8: ## Run the flake8 tool
Expand All @@ -66,12 +66,12 @@ pretty: isort black
.PHONY: isort
isort: ## Run the isort tool and update files that need to
@echo "$(BOLD)Running isort$(RESET)"
@isort `find src/ -name '*.py' | grep -v '/codec/' | xargs grep -L '# coding: mixt'`
@isort `find src/ -name '*.py' | grep -v '/codec\|vendor/' | xargs grep -L '# coding: mixt'`

.PHONY: black
black: ## Run the black tool and update files that need to
@echo "$(BOLD)Running black$(RESET)"
@black `find src/ -name '*.py' | grep -v '/codec/' | xargs grep -L '# coding: mixt'`
@black `find src/ -name '*.py' | grep -v '/codec\|vendor/' | xargs grep -L '# coding: mixt'`

.PHONY: tests test
test: tests
Expand Down
10 changes: 8 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ packages = find:
package_dir =
=src
install_requires =
pytypes @ git+ssh://git@github.com/Stewori/pytypes@b7271ec654d3553894febc6e0d8ad1b0e1ac570a
wrapt

[options.packages.find]
Expand Down Expand Up @@ -101,6 +100,10 @@ ignore_errors = True
# strange modules with errors from mypy
ignore_errors = True

[mypy-src.mixt.vendor.*]
# ignore vendored code
ignore_errors = True

[flake8]
ignore =
# Line too long: we let black manage it
Expand Down Expand Up @@ -140,6 +143,7 @@ exclude =
dist/
build/
src/mixt/codec/
src/mixt/vendor/
tests/pyxl/original/
per-file-ignores =
# ignore mypy missing annotations in tests
Expand All @@ -159,12 +163,13 @@ max-line-length = 99
addopts =
--doctest-modules
--ignore setup.py
--ignore vendor
--pyargs

[coverage:run]
branch = True

[isort]
[tool:isort]
combine_as_imports=1
default_section=THIRDPARTY
force_sort_within_sections=1
Expand All @@ -178,3 +183,4 @@ multi_line_output=3
not_skip = __init__.py
sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
use_parentheses=1
skip=vendor,codec
9 changes: 4 additions & 5 deletions src/mixt/internal/proptypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
import keyword
from typing import Any, Dict, Set, Type, get_type_hints

from pytypes import ( # we use "pytypes" to check complex types
TypeCheckError,
typechecked,
)

from ..exceptions import (
InvalidPropBoolError,
InvalidPropChoiceError,
Expand All @@ -19,6 +14,10 @@
RequiredPropError,
)
from ..proptypes import Choices, DefaultChoices, NotProvided, Required
from ..vendor.pytypes import ( # we use "pytypes" to check complex types
TypeCheckError,
typechecked,
)


FUTURE_KEYWORDS: Set[str] = {
Expand Down
Empty file added src/mixt/vendor/__init__.py
Empty file.
Loading

0 comments on commit b2e6f39

Please sign in to comment.