From 0be41fe4dd9d206235da8c79532e601e97c86b18 Mon Sep 17 00:00:00 2001 From: Matt Tancik Date: Fri, 6 May 2022 11:57:40 -0700 Subject: [PATCH] Use pyproject.toml --- .github/workflows/code_checks.yml | 16 ++++------------ .vscode/settings.json | 14 -------------- README.md | 2 +- pyproject.toml | 29 ++++++++++++++++++++++++++++- setup.cfg | 9 +++++++++ setup.py | 11 ----------- 6 files changed, 42 insertions(+), 39 deletions(-) create mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/code_checks.yml b/.github/workflows/code_checks.yml index 3cfc108c1..0a0e2da60 100644 --- a/.github/workflows/code_checks.yml +++ b/.github/workflows/code_checks.yml @@ -23,22 +23,14 @@ jobs: run: | python -m pip install --upgrade pip pip install -r environment/requirements.txt - python setup.py develop + pip install -e . - name: Run Black uses: psf/black@stable with: - options: "--check --verbose --line-length=120" + options: "--check" - name: Python Pylint run: | - pylint mattport tests \ - --max-line-length=120 \ - --generated-members=numpy.*,torch.*,cv2.*,cv.* \ - --good-names=e,c,i,j,x,y,lr,K,fx,fy,cx,cy,H,W,ts,t,u,k,v \ - --disable=too-many-arguments \ - --disable=too-many-locals \ - --disable=fixme \ - --disable=too-many-instance-attributes \ - --disable=duplicate-code + pylint mattport tests - name: Test with pytest run: | - pytest tests --typeguard-packages=mattport --torchtyping-patch-typeguard --disable-warnings + pytest diff --git a/.vscode/settings.json b/.vscode/settings.json index 885849bfb..2196d04e5 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -19,20 +19,6 @@ "python.sortImports.args": [ "--src=${workspaceFolder}" ], - "python.testing.pytestArgs": [ - "--ignore=tests/nerf/test_ray_generator.py", - "--typeguard-packages=mattport", - "--torchtyping-patch-typeguard" - ], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true, - "python.linting.pylintArgs": [ - "--generated-members=numpy.*,torch.*,cv2.*,cv.*", - "--max-line-length=120", - "--good-names=e,c,i,j,x,y,lr,K,fx,fy,cx,cy,H,W,ts,t,u,k,v", - "--disable=too-many-arguments", - "--disable=fixme", - "--disable=too-many-locals", - "--disable=too-many-instance-attributes" - ], } \ No newline at end of file diff --git a/README.md b/README.md index 134911c4d..220798083 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ conda activate mattport pip install -r environment/requirements.txt # Install mattport as a library -python setup.py develop +pip install -e . # Running the test cases pytest tests diff --git a/pyproject.toml b/pyproject.toml index e34796ec5..8a009c6e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,2 +1,29 @@ +[build-system] +requires = ["setuptools>=42"] +build-backend = "setuptools.build_meta" + +# black [tool.black] -line-length = 120 \ No newline at end of file +line-length = 120 + +# pylint +[tool.pylint.messages_control] + +max-line-length = 120 +generated-members = ["numpy.*", "torch.*", "cv2.*", "cv.*"] +good-names-rgxs= "^[_a-zA-Z][_a-z0-9]?$" + +disable = [ + "too-many-arguments", + "fixme", + "too-many-locals", + "too-many-instance-attributes", + "duplicate-code", +] + +#pytest +[tool.pytest.ini_options] +addopts = "--typeguard-packages=mattport --torchtyping-patch-typeguard --disable-warnings" +testpaths = [ + "tests", +] \ No newline at end of file diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..1d92ebac3 --- /dev/null +++ b/setup.cfg @@ -0,0 +1,9 @@ +[metadata] +name = mattport +version = 0.0.1 +description = Volumetric rendering package +long_description = file: README.md + +[options] +packages = find: +python_requires = >=3.8, \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 705b32197..000000000 --- a/setup.py +++ /dev/null @@ -1,11 +0,0 @@ -import setuptools - -setuptools.setup( - name="mattport", - version="1.0.0", - author="MattPort", - url="https://github.com/ethanweber/mattport.git", - description="mattport description", - packages=setuptools.find_packages(), - python_requires=">=3.8", -)