-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve dev experience * Add pytest and flake8 commands to readme * Use --filename in flake8 * Lint all py files * Add Makefile and update readme * Lint
- Loading branch information
1 parent
6e9c563
commit e14d79e
Showing
8 changed files
with
53 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# Ignore models dir | ||
spacy_udpipe/models | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.PHONY: lint test | ||
|
||
# Lint source code | ||
|
||
lint: | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 --filename=*.py --count --show-source --max-line-length=119 --statistics | ||
# exit-zero treats all errors as warnings | ||
flake8 --filename=*.py --count --exit-zero --max-line-length=119 --max-complexity=10 --statistics | ||
|
||
# Run tests | ||
|
||
test: | ||
python -m pytest -vvv tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import os | ||
|
||
import setuptools | ||
from setuptools import find_packages, setup | ||
|
||
|
||
def get_version(fname: str) -> str: | ||
|
@@ -9,11 +9,11 @@ def get_version(fname: str) -> str: | |
"spacy_udpipe", | ||
fname | ||
) | ||
with open(full_path, "r") as fp: | ||
for l in fp: | ||
if l.startswith("__version__"): | ||
delim = '"' if '"' in l else "'" | ||
return l.split(delim)[1] | ||
with open(full_path, "r", encoding="utf-8") as fp: | ||
for line in fp: | ||
if line.startswith("__version__"): | ||
delim = '"' if '"' in line else "'" | ||
return line.split(delim)[1] | ||
else: | ||
raise RuntimeError( | ||
"Unable to find version string." | ||
|
@@ -22,10 +22,10 @@ def get_version(fname: str) -> str: | |
|
||
URL = "https://github.com/TakeLab/spacy-udpipe" | ||
|
||
with open("README.md", "r") as f: | ||
with open("README.md", "r", encoding="utf-8") as f: | ||
readme = f.read() | ||
|
||
setuptools.setup( | ||
setup( | ||
name="spacy_udpipe", | ||
version=get_version("__init__.py"), | ||
description="Use fast UDPipe models directly in spaCy", | ||
|
@@ -36,8 +36,11 @@ def get_version(fname: str) -> str: | |
author_email="[email protected]", | ||
license="MIT", | ||
keywords="nlp udpipe spacy python", | ||
packages=setuptools.find_packages(), | ||
packages=find_packages(), | ||
install_requires=["spacy>=3.0.0,<4.0.0", "ufal.udpipe>=1.2.0"], | ||
extras_require={ | ||
"dev": ["flake8", "pytest"], | ||
}, | ||
python_requires=">=3.6", | ||
entry_points={ | ||
"spacy_tokenizers": [ | ||
|
@@ -49,9 +52,15 @@ def get_version(fname: str) -> str: | |
classifiers=[ | ||
"Development Status :: 4 - Beta", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Intended Audience :: Science/Research" | ||
"Programming Language :: Python :: 3", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: OS Independent", | ||
"Topic :: Software Development", | ||
"Topic :: Software Development :: Libraries", | ||
"Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
"Topic :: Text Processing", | ||
], | ||
project_urls={ | ||
"SpaCy": "https://spacy.io/", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters