From d7783969e009dd8982f25a8bebabab00adec5538 Mon Sep 17 00:00:00 2001 From: Hynn01 Date: Tue, 8 Feb 2022 16:29:31 +0100 Subject: [PATCH] use poetry to replace setup.py --- .github/workflows/build.yml | 5 ++++- .gitignore | 5 ++++- pyproject.toml | 45 +++++++++++++++++++++++++++++++++++++ setup.py | 31 ------------------------- 4 files changed, 53 insertions(+), 33 deletions(-) delete mode 100644 setup.py diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e31f0bd..151587c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,7 +25,10 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - pip install -e . + # pip install -e . + # curl -sSL https://install.python-poetry.org | python3 - + pip install poetry + poetry install - name: Run tests run: | diff --git a/.gitignore b/.gitignore index 47ad1d4..c2e395a 100644 --- a/.gitignore +++ b/.gitignore @@ -142,4 +142,7 @@ dmypy.json .DS_Store # Hugo -docs/gh-pages/public \ No newline at end of file +docs/gh-pages/public + +# poetry +poetry.lock \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index e593108..1b434e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,3 +19,48 @@ exclude = ''' [tool.isort] skip = 'scripts' + +[tool.poetry] +name = "dslinter" +version = "1.1.0" +description = "`dslinter` is a pylint plugin for linting data science and machine learning code. We plan to support the following Python libraries: TensorFlow, PyTorch, Scikit-Learn, Pandas, NumPy and SciPy." + +license = "GPL-3.0 License" + +authors = [ + "Mark Haakman", + "Haiyin Zhang", + "Daoyao Wang", + "Chadha Degachi" +] + +readme = "README.md" # Markdown files are supported + +repository = "https://github.com/Hynn01/dslinter" +homepage = "https://pypi.org/project/dslinter/" + +keywords = ["machine learning", "software engineering"] + +[tool.poetry.dependencies] +python = "^3.7" # Compatible python versions must be declared here +toml = "^0.9" +# Dependencies with extras +# requests = { version = "^2.13", extras = [ "security" ] } +# Python specific dependencies with prereleases allowed +# pathlib2 = { version = "^2.2", allow-prereleases = true } +# Git dependencies +# cleo = { git = "https://github.com/sdispater/cleo.git", branch = "master" } +# Optional dependencies (extras) +# pendulum = { version = "^1.4", optional = true } +pylint = { version = "2.12.2" } +astroid = { version = "2.9.3" } +mypy = { version = "0.931" } +data-science-types = { version = "0.2.23" } +pyspark-stubs = {version = "3.0.0.post3" } + +[tool.poetry.dev-dependencies] +pytest = "^3.0" +pytest-cov = "^2.4" + +# [tool.poetry.scripts] +# my-script = "my_package:main" \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index 1172a1d..0000000 --- a/setup.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Setup script.""" -from setuptools import find_packages, setup - -# Get the long description from the README file -with open("README.md", encoding="utf-8") as f: - long_description = f.read() - -setup( - name="dslinter", - version="1.1.0", - description="Pylint plugin for linting data science and machine learning code, focussed on the libraries pandas and scikit-learn.", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/Hynn01/dslinter", - author="Mark Haakman, Haiyin Zhang, Daoyao Wang, Chadha Degachi", - packages=find_packages(), - package_data={"": ["*.pickle"]}, - python_requires="~=3.5", - install_requires=["pylint==2.12.2", "astroid==2.9.3", "mypy", "data-science-types", "pyspark-stubs"], - classifiers=[ - "Development Status :: 5 - Production/Stable", - "Environment :: Plugins", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", - "Operating System :: OS Independent", - "Programming Language :: Python :: 3 :: Only", - "Topic :: Scientific/Engineering :: Artificial Intelligence", - "Topic :: Software Development :: Quality Assurance", - ], -)