Skip to content

Commit

Permalink
Merge pull request #41 from koordinates/packaging-updates
Browse files Browse the repository at this point in the history
Modernise packaging
  • Loading branch information
craigds authored Mar 20, 2024
2 parents bfe4b00 + 9bc5ac5 commit 9d3435a
Show file tree
Hide file tree
Showing 9 changed files with 75 additions and 130 deletions.
53 changes: 12 additions & 41 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,38 @@
steps:
- label: ":building_construction: build everything"
command:
- python setup.py sdist bdist_wheel
- python -m build
- pip install dist/*.whl
- pip install -r requirements-dev.txt
- make zipdocs
plugins:
docker#v1.4.0:
image: "${ECR}/ci-tools:latest"
workdir: /app
artifact_paths:
artifact_paths:
- dist/*
- docs/build/docs.zip

- wait

- label: ":pytest: run tests (:python: 3.8)"
- label: ":pytest: run tests (:python: {{matrix.python}})"
command:
- ./.buildkite/test.sh
plugins:
artifacts#v1.2.0:
download: "dist/*.whl"
docker#v1.4.0:
image: "python:3.8-alpine"
workdir: /app
shell: false
artifact_paths: "./pytest*.xml"

- label: ":pytest: run tests (:python: 3.9)"
command:
- ./.buildkite/test.sh
plugins:
artifacts#v1.2.0:
download: "dist/*.whl"
docker#v1.4.0:
image: "python:3.9-alpine"
workdir: /app
shell: false
artifact_paths: "./pytest*.xml"

- label: ":pytest: run tests (:python: 3.10)"
command:
- ./.buildkite/test.sh
plugins:
artifacts#v1.2.0:
download: "dist/*.whl"
docker#v1.4.0:
image: "python:3.10-alpine"
workdir: /app
shell: false
artifact_paths: "./pytest*.xml"

- label: ":pytest: run tests (:python: 3.7)"
command:
- ./.buildkite/test.sh
plugins:
artifacts#v1.2.0:
download: "dist/*.whl"
docker#v1.4.0:
image: "python:3.7-alpine"
docker#v5.10.0:
image: "python:{{matrix.python}}-alpine"
workdir: /app
shell: false
artifact_paths: "./pytest*.xml"
matrix:
setup:
python:
- "3.7"
- "3.8"
- "3.9"
- "3.10"

# Record test failures
- wait: ~
Expand Down
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ __pycache__/
# Distribution / packaging
.Python
env/
venv/
build/
develop-eggs/
dist/
Expand Down Expand Up @@ -65,5 +66,3 @@ target/

# MacOS
.DS_Store


12 changes: 3 additions & 9 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,7 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
import shlex

sys.path.append(os.path.join(os.path.dirname(__file__), "../.."))
sys.path.append(os.path.join(os.path.dirname(__file__), "../../koordinates"))
import koordinates
from koordinates import __version__
import importlib.metadata

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand Down Expand Up @@ -61,7 +54,8 @@
# built documents.
#
# The short X.Y version.
version = __version__
version = importlib.metadata.version("koordinates")

# The full version, including alpha/beta/rc tags.
release = version

Expand Down
18 changes: 8 additions & 10 deletions docs/source/user/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Koordinates welcomes bug reports and contributions by the community to this modu
Testing
-------

The client includes a suite of unit and functional tests. These should be used to verify that your changes don't break existing functionality, and that compatibility is maintained across supported Python versions. `Tests run automatically on CircleCI <https://circleci.com/gh/koordinates/python-client>`_ for branch commits and pull requests.
The client includes a suite of unit and functional tests. These should be used to verify that your changes don't break existing functionality, and that compatibility is maintained across supported Python versions. `Tests run automatically on Buildkite <https://buildkite.com/koordinates/python-client/>`_ for branch commits and pull requests.

To run the tests you need to::

Expand All @@ -32,7 +32,7 @@ Preparations
#. Close or update all tickets for the `next milestone on Github.
<https://github.com/koordinates/python-client/milestones?direction=asc&sort=due_date&state=open>`_.

#. Update the *minimum* required versions of dependencies in :file:`setup.py`.
#. Update the *minimum* required versions of dependencies in :file:`pyproject.toml`.
Update the *exact* version of all entries in :file:`requirements.txt`.

#. Run :command:`tox` from the project root. All tests for all supported Python versions must pass:
Expand All @@ -42,7 +42,7 @@ Preparations
$ tox
[...]
________ summary ________
py34: commands succeeded
py37: commands succeeded
...
congratulations :)
Expand All @@ -59,7 +59,7 @@ Preparations
.. note::

You will need to install dev dependancies in :file:`requirements-dev.txt` to build documentation.
You will need to install dev dependencies in :file:`requirements-dev.txt` to build documentation.

#. Check the `Buildkite build <https://buildkite.com/koordinates/python-client>`_ is passing.

Expand All @@ -85,9 +85,9 @@ Build and release

.. code-block:: bash
$ python setup.py sdist
$ python3 -m build
$ ls dist/
koordinates-0.0.0.tar.gz
koordinates-0.7.0-py3-none-any.whl koordinates-0.7.0.tar.gz
Try installing them:

Expand All @@ -98,8 +98,6 @@ Build and release
$ /tmp/koordinates-sdist/bin/pip install dist/koordinates-0.0.0.tar.gz
$ /tmp/koordinates-sdist/bin/python
>>> import koordinates
>>> koordinates.__version__
'0.0.0'
#. Create or check your accounts for the `test server <https://testpypi.python.org/pypi>`
and `PyPI <https://pypi.python.org/pypi>`_. Update your :file:`~/.pypirc` with your
Expand All @@ -126,7 +124,7 @@ Build and release

.. code-block:: bash
$ python setup.py sdist upload -r test
$ twine upload -r test dist/*
$ rm -rf /tmp/koordinates-sdist # ensure clean state
$ virtualenv /tmp/koordinates-sdist
Expand All @@ -139,7 +137,7 @@ Build and release

.. code-block:: bash
$ python setup.py sdist upload -r pypi
$ twine upload -r pypi dist/*
$ rm -rf /tmp/koordinates-sdist # ensure clean state
$ virtualenv /tmp/koordinates-sdist
Expand Down
2 changes: 0 additions & 2 deletions koordinates/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
:license: BSD, see LICENSE for more details.
"""

__version__ = "0.6.0"

from .exceptions import (
KoordinatesException,
ClientError,
Expand Down
51 changes: 50 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,51 @@
[build-system]
build-backend = "setuptools.build_meta"
requires = ["setuptools>=61.0"]

[project]
authors = [
{name = "Koordinates Limited", email = "support@koordinates.com"},
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Scientific/Engineering :: GIS",
]
dependencies = [
"python-dateutil>=2,<3",
"pytz",
"requests>=2.5,<3",
"requests-toolbelt",
]
description = "A Python client library for a number of Koordinates web APIs"
dynamic = ["readme"]
keywords = ["koordinates", "api"]
name = "koordinates"
requires-python = ">=3.7"
version = "0.7.0"

[project.urls]
Source = "https://github.com/koordinates/python-client"

[project.optional-dependencies]
dev = [
"coverage>=3.7,<4",
"pytest>=3.3",
"responses>=0.3",
]

[tool.setuptools]
packages = ["koordinates"]

[tool.setuptools.dynamic]
readme = {file = "README.md", content-type = "text/markdown"}

[tool.black]
target-version = ['py34']
target-version = ['py37']
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
-r requirements-test.txt

build
Babel~=2.7
Jinja2<3.1
MarkupSafe
Expand Down
5 changes: 0 additions & 5 deletions setup.cfg

This file was deleted.

60 changes: 0 additions & 60 deletions setup.py

This file was deleted.

0 comments on commit 9d3435a

Please sign in to comment.