From b69a0dfdf43ec332bb34047345436bc9f50b7b1a Mon Sep 17 00:00:00 2001 From: Joohwan Oh Date: Thu, 31 Mar 2022 18:37:26 -0700 Subject: [PATCH] Remove setuptools_scm from dependency and switch back to manual versioning --- .github/workflows/build.yaml | 2 +- .github/workflows/pypi.yaml | 31 ------------------------------- .gitignore | 3 --- .pre-commit-config.yaml | 9 +++++---- README.md | 6 +++--- arango/client.py | 5 ++--- arango/version.py | 1 + docs/index.rst | 4 ++-- pyproject.toml | 8 +++++--- setup.cfg | 4 ---- setup.py | 24 +++++++++++++----------- 11 files changed, 32 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/pypi.yaml create mode 100644 arango/version.py diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index d30dc6a0..a557f955 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [ 3.6, 3.7, 3.8, 3.9 ] + python-version: [ 3.7, 3.8, 3.9 ] steps: - uses: actions/checkout@v2 - name: Create ArangoDB Docker container diff --git a/.github/workflows/pypi.yaml b/.github/workflows/pypi.yaml deleted file mode 100644 index db0985cd..00000000 --- a/.github/workflows/pypi.yaml +++ /dev/null @@ -1,31 +0,0 @@ -name: Upload to PyPI -on: - release: - types: [published] -jobs: - upload: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Fetch complete history for all tags and branches - run: git fetch --prune --unshallow - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine setuptools-scm[toml] - - name: Build distribution - run: python setup.py sdist bdist_wheel - - name: Publish to PyPI Test - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TEST_TOKEN }} - run: twine upload --repository testpypi dist/* - - name: Publish to PyPI - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} - run: twine upload --repository pypi dist/* diff --git a/.gitignore b/.gitignore index 2a2bde61..94598c81 100644 --- a/.gitignore +++ b/.gitignore @@ -114,6 +114,3 @@ localdata/ # Node Modules node_modules/ - -# setuptools_scm -arango/version.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e78053c0..887873a4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,20 +12,21 @@ repos: - id: end-of-file-fixer - id: mixed-line-ending - repo: https://github.com/psf/black - rev: 20.8b1 + rev: 22.3.0 hooks: - id: black - repo: https://github.com/timothycrosley/isort - rev: 5.7.0 + rev: 5.10.1 hooks: - id: isort args: [ --profile, black ] - repo: https://github.com/pre-commit/mirrors-mypy - rev: v0.790 + rev: v0.931 hooks: - id: mypy files: ^arango/ + additional_dependencies: ['types-requests'] - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + rev: 4.0.1 hooks: - id: flake8 diff --git a/README.md b/README.md index 3444f104..20ce6a6a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![codecov](https://codecov.io/gh/ArangoDB-Community/python-arango/branch/main/graph/badge.svg?token=M8zrjrzsUY)](https://codecov.io/gh/ArangoDB-Community/python-arango) [![PyPI version](https://badge.fury.io/py/python-arango.svg)](https://badge.fury.io/py/python-arango) [![GitHub license](https://img.shields.io/github/license/ArangoDB-Community/python-arango?color=brightgreen)](https://github.com/ArangoDB-Community/python-arango/blob/main/LICENSE) -![Python version](https://img.shields.io/badge/python-3.6%2B-blue) +![Python version](https://img.shields.io/badge/python-3.7%2B-blue) # Python-Arango @@ -15,12 +15,12 @@ database natively supporting documents, graphs and search. ## Requirements - ArangoDB version 3.7+ -- Python version 3.6+ +- Python version 3.7+ ## Installation ```shell -pip install python-arango +pip install python-arango --upgrade ``` ## Getting Started diff --git a/arango/client.py b/arango/client.py index 71b4eb51..75f32539 100644 --- a/arango/client.py +++ b/arango/client.py @@ -3,8 +3,6 @@ from json import dumps, loads from typing import Any, Callable, Optional, Sequence, Union -from pkg_resources import get_distribution - from arango.connection import ( BasicConnection, Connection, @@ -20,6 +18,7 @@ RoundRobinHostResolver, SingleHostResolver, ) +from arango.version import version class ArangoClient: @@ -101,7 +100,7 @@ def version(self) -> str: :return: Client version. :rtype: str """ - return get_distribution("python-arango").version + return version def db( self, diff --git a/arango/version.py b/arango/version.py new file mode 100644 index 00000000..5b13d133 --- /dev/null +++ b/arango/version.py @@ -0,0 +1 @@ +version = "7.3.2" diff --git a/docs/index.rst b/docs/index.rst index 8566733d..e14a658d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -11,14 +11,14 @@ Requirements ============= - ArangoDB version 3.7+ -- Python version 3.6+ +- Python version 3.7+ Installation ============ .. code-block:: bash - ~$ pip install python-arango + ~$ pip install python-arango --upgrade Contents ======== diff --git a/pyproject.toml b/pyproject.toml index 1d2140e8..6eed878e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = [ "setuptools>=42", - "setuptools_scm[toml]>=3.4", "wheel", ] build-backend = "setuptools.build_meta" @@ -21,5 +20,8 @@ addopts = "-s -vv -p no:warnings" minversion = "6.0" testpaths = ["tests"] -[tool.setuptools_scm] -write_to = "arango/version.py" +[tool.mypy] +warn_return_any = true +warn_unused_configs = true +ignore_missing_imports = true +strict = true diff --git a/setup.cfg b/setup.cfg index 894042b5..e600ca8d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,7 +3,3 @@ max-line-length = 88 extend-ignore = E203, E741, W503 exclude =.git .idea .*_cache dist htmlcov venv per-file-ignores = __init__.py:F401 - -[mypy] -ignore_missing_imports = True -strict = True diff --git a/setup.py b/setup.py index a1b45b1f..48d06873 100644 --- a/setup.py +++ b/setup.py @@ -3,21 +3,24 @@ with open("./README.md") as fp: long_description = fp.read() +version = {} +with open("./arango/version.py") as fp: + exec(fp.read(), version) + setup( name="python-arango", description="Python Driver for ArangoDB", long_description=long_description, long_description_content_type="text/markdown", + version=version["version"], author="Joohwan Oh", author_email="joohwan.oh@outlook.com", url="https://github.com/ArangoDB-Community/python-arango", keywords=["arangodb", "python", "driver"], packages=find_packages(exclude=["tests"]), include_package_data=True, - python_requires=">=3.6", + python_requires=">=3.7", license="MIT", - use_scm_version=True, - setup_requires=["setuptools_scm"], install_requires=[ "urllib3>=1.26.0", "dataclasses>=0.6; python_version < '3.7'", @@ -25,18 +28,17 @@ "requests_toolbelt", "PyJWT", "setuptools>=42", - "setuptools_scm[toml]>=3.4", ], extras_require={ "dev": [ - "black", - "flake8>=3.8.4", - "isort>=5.0.0", - "mypy>=0.790", + "black>=22.3.0", + "flake8>=4.0.1", + "isort>=5.10.1", + "mypy>=0.942", "mock", - "pre-commit>=2.9.3", - "pytest>=6.0.0", - "pytest-cov>=2.0.0", + "pre-commit>=2.17.0", + "pytest>=7.1.1", + "pytest-cov>=3.0.0", "sphinx", "sphinx_rtd_theme", "types-pkg_resources",