-
Notifications
You must be signed in to change notification settings - Fork 249
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 mypy + pytest global config + small fixes. #259
base: master
Are you sure you want to change the base?
Changes from 16 commits
3305a7d
fd77332
f165d70
74e3d85
111f7c9
226aa79
ad968c8
99ab6cd
d8f8ddc
bc57ef0
f7392ad
493405b
54c0e6c
6259d7b
7451767
ee6c087
30d3e2e
62ae64f
cea578b
f72e43f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
VERSION = "1.1.0" | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[tool.black] | ||
line-length = 120 | ||
|
||
Comment on lines
+1
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorted alphabetically. |
||
[tool.isort] | ||
known_first_party = "argoverse" | ||
known_third_party = "mayavi,pytest,colour,descartes,imageio,matplotlib,motmetrics,numpy,cv2,pandas,pillow,imageio,pyntcloud,scipy,shapely,sklearn" | ||
|
@@ -6,5 +9,9 @@ line_length = 120 | |
multi_line_output = 3 | ||
profile = "black" | ||
|
||
[tool.black] | ||
line-length = 120 | ||
[tool.mypy] | ||
ignore_missing_imports = true | ||
strict = true | ||
Comment on lines
+12
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there a specific version of mypy that we need to enforce, to be able to use this functionality? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we use |
||
|
||
[tool.pytest.ini_options] | ||
addopts = "--cov argoverse --cov-append --cov-branch --cov-report=term-missing" | ||
Comment on lines
+16
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,59 @@ | ||
[metadata] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Static declaration of metadata previously listed in |
||
author = Argo AI | ||
author_email = [email protected] | ||
classifiers = | ||
Development Status :: 5 - Production/Stable | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: MIT License | ||
Operating System :: POSIX | ||
Operating System :: MacOS | ||
Programming Language :: Python :: 3 | ||
Topic :: Scientific/Engineering :: Artificial Intelligence | ||
description_file = README.md | ||
keywords = | ||
self-driving-car | ||
dataset-tools | ||
license = MIT | ||
name = argoverse | ||
url = https://www.argoverse.org | ||
version = attr: argoverse.VERSION | ||
|
||
[options] | ||
zip_safe = False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we want zip_safe = False? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was just a default option listed here: https://setuptools.readthedocs.io/en/latest/userguide/declarative_config.html?highlight=zip_safe. I don't have a strong opinion on it. |
||
include_package_data = True | ||
packages = find: | ||
install_requires = | ||
colour | ||
descartes | ||
imageio | ||
h5py | ||
hydra-core ==1.1.0 | ||
lap | ||
matplotlib | ||
motmetrics ==1.1.3 | ||
numpy ==1.19 | ||
omegaconf ==2.1.0 | ||
opencv-python >=4.1.0.25 | ||
pandas >=0.23.1 | ||
pillow | ||
imageio | ||
pyntcloud >=0.1.0 | ||
scipy >=1.4.0 | ||
shapely | ||
sklearn | ||
tqdm | ||
typing_extensions | ||
|
||
[options.package_data] | ||
argoverse = argoverse/visualization/data/**/* | ||
|
||
[options.packages.find] | ||
exclude = | ||
integration_tests | ||
map_files | ||
tests | ||
|
||
[flake8] | ||
enable_extensions = G | ||
ignore = E203,E704,E711,E722,E741,W291,W293,W391,W503,F821,F401,F811,F841,P101,G004,G002,I201,I100,I101 | ||
max_line_length = 120 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,67 +7,12 @@ | |
""" | ||
|
||
import platform | ||
import sys | ||
from codecs import open # To use a consistent encoding | ||
from os import path | ||
|
||
# Always prefer setuptools over distutils | ||
from setuptools import find_packages, setup | ||
|
||
here = path.abspath(path.dirname(__file__)) | ||
|
||
# Get the long description from the README file | ||
with open(path.join(here, "README.md"), encoding="utf-8") as f: | ||
long_description = f.read() | ||
|
||
|
||
if platform.system() == "Windows": | ||
print("Argoverse currently does not support Windows, please use Linux/Mac OS") | ||
sys.exit(1) | ||
exit(1) | ||
|
||
setup( | ||
name="argoverse", | ||
version="1.0.1", | ||
description="", | ||
long_description=long_description, | ||
url="https://www.argoverse.org", | ||
author="Argo AI", | ||
author_email="[email protected]", | ||
license="MIT", | ||
classifiers=[ | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Operating System :: POSIX", | ||
"Operating System :: MacOS", | ||
"Programming Language :: Python :: 3", | ||
"Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
], | ||
keywords="self-driving-car dataset-tools", | ||
packages=find_packages(exclude=["tests", "integration_tests", "map_files"]), | ||
package_data={"argoverse": ["argoverse/visualization/data/**/*"]}, | ||
include_package_data=True, | ||
python_requires=">= 3.7", | ||
install_requires=[ | ||
"colour", | ||
"descartes", | ||
"imageio", | ||
"h5py", | ||
"hydra-core==1.1.0", | ||
"lap", | ||
"matplotlib", | ||
"motmetrics==1.1.3", | ||
"numpy==1.19", | ||
"omegaconf==2.1.0", | ||
"opencv-python>=4.1.0.25", | ||
"pandas>=0.23.1", | ||
"pillow", | ||
"imageio", | ||
"pyntcloud>=0.1.0", | ||
"scipy>=1.4.0", | ||
"shapely", | ||
"sklearn", | ||
"tqdm", | ||
"typing_extensions", | ||
], | ||
) | ||
setup() |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,9 +13,10 @@ deps = | |
|
||
commands = | ||
python3 -m pip install numba | ||
pytest tests --cov argoverse --cov-append --cov-branch --cov-report=term-missing | ||
flake8 --max-line-length 120 --ignore E203,E704,E711,E722,E741,W291,W293,W391,W503,F821,F401,F811,F841,P101,G004,G002,I201,I100,I101 --enable-extensions G argoverse | ||
mypy --ignore-missing --strict argoverse | ||
pytest tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. have we verified that these options get picked up from the pyproject.toml file in practice? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some of these can be verified by looking at the |
||
flake8 argoverse | ||
mypy argoverse | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These flags reside in either |
||
|
||
depends = | ||
py3{7,8}: clean | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used in
setup.cfg
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the version required to be placed here? This probably wouldnt be a place I would look for the version number, so do we need to write it in 2 places now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the first method listed here: https://packaging.python.org/guides/single-sourcing-package-version/#single-sourcing-the-package-version. Although, they use
__version__
instead ofVERSION
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated to use
__version__
.