Skip to content

Draft: Make publishable to PyPI

Nick Whitelegg requested to merge nickw1/geovisio:pypi-publish into develop

This follows on from !123 (merged) in that it actually makes the API publishable to PyPI.

Following the recommendation at https://packaging.python.org/en/latest/tutorials/packaging-projects/, the geovisio directory, containing the source code, has been moved into a src directory once more. (However the server directory is still not present).

As a result, the tests have been changed to now import from src.geovisio.

The setup.cfg file has been moved into the source directory src/geovisio, so that it's included when you install the package.

The PyPI package has been tested as working, see example project at https://gitlab.com/nickw1/geovisio-test. You have to install from TestPyPI; see the README.md in that repository.

The standard test suite server-test passes. However the server-test-api-conformance test suite fails, reporting dependency issues. I am not sure why this is.

flit is used to upload to PyPI.

I had to make one change in the dependencies when creating the pyproject.toml (config file necessary for PyPI). It did not accept the custom 'git+https' URL for the fs-s3fs package so I used version 1.1.1 which is the latest. Is this critical? If so, I will try and find out how to resolve it. Apparently it is possible, see https://github.com/pypa/flit/issues/543. But I get this error on uploading:

Error: Can't have direct dependency: 'fs-s3fs@git+https://gitlab.com/geovisio/infra/s3fs.git@5d205e31334644e6eb175e2a78fe4d0a201d0b11' for url: https://test.pypi.org/legacy/

Not sure if anyone has any ideas on that, if not I will try and find out how to resolve it.

Merge request reports