"""This is used until we migrate to ``pyproject.toml``.""" # Standard library from platform import system import re from subprocess import check_output # Installation & setup tool import setuptools # Find Pyrate version and author strings with open("pyrate/__init__.py", "r", encoding="utf8") as fd: content = fd.read() version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]', content, re.MULTILINE).group(1) author = re.search(r'^__author__\s*=\s*[\'"]([^\'"]*)[\'"]', content, re.MULTILINE).group(1) # Import readme with open("README.md", "r", encoding="utf8") as readme: long_description = readme.read() # Get GDAL version # also cut the trailing line break from the output if system() == "Windows": gdal_version_raw = check_output(["gdalinfo", "--version"], universal_newlines=True)[:-1] # Output formatted as: "GDAL 3.1.4, released 2020/10/20" gdal_version = gdal_version_raw.split(" ", maxsplit=3)[1][:-1] # also slit away the comma at the end else: gdal_version = check_output(["gdal-config", "--version"], universal_newlines=True)[:-1] setuptools.setup( name="Pyrate", version=version, author=author, author_email="info@sailingteam.tu-darmstadt.de", description="The Pyrate package for autonomous, unmanned surface vehicles.", long_description=long_description, long_description_content_type="text/markdown", url="https://st-darmstadt.de", packages=setuptools.find_packages(), package_data={ "pyrate": ["py.typed"], # https://www.python.org/dev/peps/pep-0561/ }, classifiers=[ "Programming Language :: Python :: 3", "License :: TODO", "Operating System :: OS Independent", ], python_requires=">=3.10", install_requires=[ # => libraries for actual functionality # -> general tools "tqdm", # -> generic scientific "numpy>=1.21.0", "scipy", "pandas!=1.3.0,!=1.3.1,!=1.3.2", # See issues #128 and #129 "h5py", "tables", # needed for pandas' to_hdf5(), see # https://pandas.pydata.org/docs/user_guide/io.html#hdf5-pytables "matplotlib", "opencv-python", # -> geospatial / GIS tools "pyproj", "geopy", "geojson", "shapely<1.8.0", # See #142 "cartopy", "rasterio>=1.3b1", "pygeodesy", f"pygdal=={gdal_version}.*", # needs libgdal-dev to be installed via the system package manager # => testing and code quality "black~=22.3", "hypothesis>=6.41.0", "mypy", "pylint~=2.13.4", # Explicitly pin the version since it changes frequently and is disrupting "hacking", # This also installs flake8, mccabe and others "pytest>=6.0.0", "pytest-cov", "pytest-subtests", ], extras_require={ "docs": ["sphinx", "sphinx-markdown-builder", "sphinx_rtd_theme", "sphinxcontrib-programoutput"] }, )