From 753a5bc5c4895d10073859e2b76a7822e5c8d23e Mon Sep 17 00:00:00 2001 From: Anthony Mahanna <43019056+aMahanna@users.noreply.github.com> Date: Wed, 15 Nov 2023 08:50:45 -0500 Subject: [PATCH] Migrate to `pyproject.toml` (#12) * migrate to `pyproject.toml` * cleanup * fix mypy --- HISTORY.rst | 8 ---- README.md | 2 +- arango_datasets/datasets.py | 4 +- dev_requirements.txt | 5 --- pyproject.toml | 79 ++++++++++++++++++++++++++++++++----- requirements.txt | 4 -- setup.cfg | 12 ------ setup.py | 62 +---------------------------- 8 files changed, 74 insertions(+), 102 deletions(-) delete mode 100644 HISTORY.rst delete mode 100644 dev_requirements.txt delete mode 100644 requirements.txt delete mode 100644 setup.cfg diff --git a/HISTORY.rst b/HISTORY.rst deleted file mode 100644 index 1496721..0000000 --- a/HISTORY.rst +++ /dev/null @@ -1,8 +0,0 @@ -======= -History -======= - -0.0.0.1 (2022-10-11) ------------------- - -* First release on PyPI. diff --git a/README.md b/README.md index 7193961..957990e 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # arango_datasets Package for loading example datasets into an ArangoDB Instance. -``` +```py from arango_datasets.datasets import Datasets from arango import ArangoClient diff --git a/arango_datasets/datasets.py b/arango_datasets/datasets.py index ec59e13..560624b 100644 --- a/arango_datasets/datasets.py +++ b/arango_datasets/datasets.py @@ -132,9 +132,7 @@ def load_jsonl( def load_file(self, collection_name: str, edge_type: bool, file_url: str) -> None: collection: StandardCollection try: - collection = self.user_db.create_collection( - collection_name, edge=edge_type - ) # type: ignore + collection = self.user_db.create_collection(collection_name, edge=edge_type) except CollectionCreateError as exec: print( f"""Failed to create {collection_name} collection due diff --git a/dev_requirements.txt b/dev_requirements.txt deleted file mode 100644 index a0f5f69..0000000 --- a/dev_requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ - black>=22.8.0, - pytest>=7.1.3, - sphinx>=5.1.1, - pre-commit - diff --git a/pyproject.toml b/pyproject.toml index cf149b4..cd71201 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,77 @@ -# pyproject.toml -[tool.pytest.ini_options] -minversion = "6.0" -addopts = "-ra -q" -testpaths = [ - "tests" +[build-system] +requires = ["setuptools>=45", "wheel", "setuptools_scm"] +build-backend = "setuptools.build_meta" + +[tool.setuptools_scm] +normalize = true + +[project] +name = "arango_datasets" +description = "Package for fetching and loading datasets for ArangoDB deployments." +readme = "README.md" +dynamic = ["version"] +requires-python = ">=3.8" + + +authors = [{name = "Christopher Woodward", email = "christopher@arangodb.com"}] + +classifiers = [ + "Development Status :: 2 - Pre-Alpha", + "Intended Audience :: Developers", + "License :: OSI Approved :: Apache Software License", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Operating System :: OS Independent", +] + +dependencies = ["python-arango>=7.4.1", "requests>=2.28.1", "rich>=12.6.0"] + +[project.optional-dependencies] +dev = [ + "bandit>=1.7.4", + "black>=22.10.0", + "flake8>=5.0.4", + "Flake8-pyproject", + "isort>=5.10.1", + "mypy>=0.982", + "pre-commit>=2.20.0", + "pytest>=7.1.3", + "pytest-cov>=4.0.0", + "sphinx>=5.3.0", + "types-requests>=2.28.11.2", + "types-setuptools>=65.5.0.1", ] -[tool.black] -line-length=88 +[project.urls] +"Homepage" = "https://github.com/arangoml/arangodb_datasets" + +[tool.setuptools] +packages = ["arango_datasets"] + +[tool.pytest.ini_options] +addopts = "-s -vv" +minversion = "6.0" +testpaths = ["tests"] [tool.coverage.report] omit = ["*tests*"] [tool.coverage.run] -omit = ["*tests*"] \ No newline at end of file +omit = ["*tests*"] + +[tool.isort] +profile = "black" + +[tool.flake8] +max-line-length = 88 +extend-ignore = ["E203", "W503", "E251"] +exclude = [".git", ".idea", ".*_cache", "dist", "venv"] + +[tool.mypy] +strict = true +ignore_missing_imports = true +implicit_reexport = true +scripts_are_modules = true +follow_imports = "skip" +disallow_subclassing_any = false +disallow_untyped_decorators = false \ No newline at end of file diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 3c9b836..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ - python-arango>=2.0.1, - sphinx>=5.1.1, - - diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c5c2c0f..0000000 --- a/setup.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[isort] -profile = black - -[flake8] -max-line-length = 88 -extend-ignore = E203, W503, E251 -exclude =.git .idea .*_cache dist venv - -[mypy] -strict = True -ignore_missing_imports = True -implicit_reexport = True \ No newline at end of file diff --git a/setup.py b/setup.py index 92dfd5c..6068493 100644 --- a/setup.py +++ b/setup.py @@ -1,61 +1,3 @@ -#!/usr/bin/env python +from setuptools import setup -"""The setup script.""" - -from setuptools import find_packages, setup - -with open("HISTORY.rst") as history_file: - history = history_file.read() - -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - -install_requirements = ["python-arango>=7.4.1", "requests>=2.28.1", "rich>=12.6.0"] - - -dev_requirements = [ - "bandit>=1.7.4", - "black>=22.10.0", - "flake8>=5.0.4", - "isort>=5.10.1", - "mypy>=0.982", - "pre-commit>=2.20.0", - "pytest>=7.1.3", - "pytest-cov>=4.0.0", - "sphinx>=5.3.0", - "types-requests>=2.28.11.2", - "types-setuptools>=65.5.0.1", -] - -setup( - name="arango_datasets", - version="1.1.2", - author="Chris Woodward", - author_email="christopher@arangodb.com", - description="Package for fetching and loading datasets for ArangoDB deployments.", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/cw00dw0rd/arango_datasets", - project_urls={ - "Bug Tracker": "https://github.com/cw00dw0rd/arango_datasets", - }, - python_requires=">=3.8", - classifiers=[ - "Development Status :: 2 - Pre-Alpha", - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Operating System :: OS Independent", - ], - license="Apache Software License 2.0", - keywords="arango_datasets", - package_dir={"arango_datasets": "arango_datasets"}, - packages=find_packages(include=["arango_datasets", "arango_datasets.*"]), - include_package_data=True, - # ----- - install_requires=install_requirements, - test_suite="tests", - extras_require={"dev": dev_requirements}, - zip_safe=False, -) +setup()