diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 51a941f..be0ea0f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,7 +3,7 @@ updates: - package-ecosystem: pip directory: "/" schedule: - interval: weekly + interval: monthly day: "monday" time: "10:00" open-pull-requests-limit: 10 diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 8b90cbe..69dba44 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -31,6 +31,7 @@ jobs: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | + git fetch --tags sudo apt-get install -y libsqliteodbc unixodbc odbcinst -j cat /etc/odbcinst.ini diff --git a/aioodbc/__init__.py b/aioodbc/__init__.py index cfb700a..4dfcb47 100644 --- a/aioodbc/__init__.py +++ b/aioodbc/__init__.py @@ -3,11 +3,13 @@ from pyodbc import dataSources as _dataSources +from ._version import version, version_tuple from .connection import Connection, connect from .pool import Pool, create_pool -__version__ = "0.4.0" -__all__ = ["connect", "Connection", "create_pool", "Pool", "dataSources"] +__version__ = version +__version_tuple__ = version_tuple +__all__ = ("connect", "Connection", "create_pool", "Pool", "dataSources") async def dataSources(loop=None, executor=None): diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..94443eb --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,6 @@ +# pyproject.toml +[build-system] +requires = ["setuptools>=45", "wheel", "setuptools_scm>=6.2", "setuptools_scm_git_archive"] + +[tool.setuptools_scm] +write_to = "aioodbc/_version.py" diff --git a/requirements-dev.txt b/requirements-dev.txt index 8d09924..ae495a6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -16,6 +16,7 @@ flake8-pyi==23.3.0 flake8-tuple==0.4.1 flake8==3.9.2 ipdb==0.13.13 +twine==4.0.2 ipython==8.11.0 isort==5.12.0 pyodbc==4.0.35 diff --git a/setup.py b/setup.py index 64c9125..21c615f 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ import os -import re from setuptools import find_packages, setup @@ -13,18 +12,6 @@ def read(f): extras_require = {} -def read_version(): - regexp = re.compile(r'^__version__\W*=\W*"([\d.abrc]+)"') - init_py = os.path.join(os.path.dirname(__file__), "aioodbc", "__init__.py") - with open(init_py) as f: - for line in f: - match = regexp.match(line) - if match is not None: - return match.group(1) - else: - raise RuntimeError("Cannot find version in aioodbc/__init__.py") - - classifiers = [ "License :: OSI Approved :: Apache Software License", "Intended Audience :: Developers", @@ -42,12 +29,18 @@ def read_version(): "Framework :: AsyncIO", ] +project_urls = { + "Website": "https://github.com/jettify/uddsketch", + "Documentation": "https://uddsketch.readthedocs.io", + "Issues": "https://github.com/jettify/uddsketch/issues", +} + setup( name="aioodbc", - version=read_version(), description=("ODBC driver for asyncio."), long_description="\n\n".join((read("README.rst"), read("CHANGES.txt"))), + long_description_content_type="text/x-rst", classifiers=classifiers, platforms=["POSIX"], author="Nikolay Novik", @@ -55,9 +48,17 @@ def read_version(): url="https://github.com/aio-libs/aioodbc", download_url="https://pypi.python.org/pypi/aioodbc", license="Apache 2", - packages=find_packages(), + packages=find_packages(exclude=("tests",)), python_requires=">=3.7", install_requires=install_requires, + setup_requires=[ + "setuptools>=45", + "setuptools_scm", + "setuptools_scm_git_archive", + "wheel", + ], extras_require=extras_require, include_package_data=True, + project_urls=project_urls, + use_scm_version=True, )