diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a1cefc0b..280121f8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -30,12 +30,12 @@ jobs: - name: Install setuptools run: | python -m pip install --upgrade pip - pip install setuptools wheel twine + pip install build setuptools twine - name: Build and publish env: TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} run: | - python setup.py sdist bdist_wheel - twine upload dist/* \ No newline at end of file + python -m build + twine upload dist/* diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..116e7431 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,67 @@ +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name = "traveltimepy" +dynamic = ["version"] +description = "Python Interface to Travel Time." +readme = { file = "README.md", content-type = "text/markdown" } +keywords = ["traveltimepy", "api", "maps"] +license = { text = "MIT" } +authors = [{ name = "TravelTime" }] +requires-python = ">=3.8" +dependencies = [ + "pydantic", + "typing-extensions", + "geojson-pydantic>=1.0.1", + "shapely", + "dacite", + "certifi>=2021.5.30", + "aiohttp", + "aiolimiter", + "aiohttp-retry", + "protobuf==4.21.12", + "types-protobuf", +] +classifiers = [ + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "License :: OSI Approved :: MIT License", +] + +[project.optional-dependencies] +test = [ + "pytest", + "pytest-asyncio", + "flake8", + "flake8-pyproject", + "mypy", + "black", +] + +[tool.setuptools] +zip-safe = false +include-package-data = true +packages = { find = {} } + +[tool.setuptools.dynamic] +version = { attr = "traveltimepy.version.__version__" } + +[tool.flake8] +per-file-ignores = ["**/__init__.py:F401"] +max-line-length = 88 +extend-ignore = ["E203"] # See https://github.com/PyCQA/pycodestyle/issues/373 +exclude = ["build/", "venv/", "traveltimepy/proto/"] + +[tool.mypy] +ignore_missing_imports = true +exclude = "^(traveltimepy/proto/.*|build/.*|venv/.*)$" + +[[tool.mypy.overrides]] +module = "traveltimepy.proto.*" +follow_imports = "skip" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index dd9ba6f9..00000000 --- a/setup.cfg +++ /dev/null @@ -1,55 +0,0 @@ -[metadata] -name = traveltimepy -version = attr: traveltimepy.version.__version__ -description = "Python Interface to Travel Time." -long_description = file: README.md -long_description_content_type = text/markdown -keywords = traveltimepy, api, maps -license = MIT -author = TravelTime - - -[options] -zip_safe = False -include_package_data = True -python_requires = >=3.8 -packages = find_namespace: -install_requires = - pydantic - typing-extensions - geojson-pydantic >= 1.0.1 - shapely - dacite - certifi >= 2021.5.30 - aiohttp - aiolimiter - aiohttp-retry - protobuf == 4.21.12 - types-protobuf - -[options.extras_require] -test = - pytest - pytest-asyncio - flake8 - mypy - black - -[flake8] -per-file-ignores = __init__.py:F401 -max-line-length = 88 -extend-ignore = - # See https://github.com/PyCQA/pycodestyle/issues/373 - E203, -exclude = - build/ - venv/ - traveltimepy/proto/ - -[mypy] -ignore_missing_imports = True -exclude = ^(traveltimepy/proto/.*|build/.*|venv/.*)$ - -[mypy-traveltimepy/proto.*] -follow_imports = skip - diff --git a/setup.py b/setup.py deleted file mode 100644 index 4da1fcae..00000000 --- a/setup.py +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env python -"""See `setup.cfg` for configuration. This just allows editable installs.""" - -import setuptools - -if __name__ == "__main__": - setuptools.setup() diff --git a/traveltimepy/version.py b/traveltimepy/version.py index ae7c2baf..4b76f0fe 100644 --- a/traveltimepy/version.py +++ b/traveltimepy/version.py @@ -1 +1 @@ -__version__ = "3.9.9" +__version__ = "3.9.10"