From 07fe22b669a58b082bf480d668fa6c7ddf9f6323 Mon Sep 17 00:00:00 2001 From: atmorling Date: Mon, 1 Jul 2024 16:50:53 +0200 Subject: [PATCH] 113/packaging (#191) Co-authored-by: Charles Stern <62192187+cisaacstern@users.noreply.github.com> --- .github/workflows/publish.yml | 1 + .gitignore | 1 + MANIFEST.in | 4 -- ecoscope/version.py | 1 - pyproject.toml | 82 ++++++++++++++++++++++++++++++++++- setup.py | 81 ---------------------------------- 6 files changed, 82 insertions(+), 88 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 ecoscope/version.py delete mode 100644 setup.py diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 020bc5e5..04ca518f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,7 @@ on: push: tags: - "v[0-9]+.[0-9]+.[0-9]+" + - "v[0-9]+.[0-9]+.[0-9]+-rc" branches: - "master" diff --git a/.gitignore b/.gitignore index 5950d1ce..bfb01581 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ share/python-wheels/ .installed.cfg *.egg MANIFEST +_version.py # PyInstaller # Usually these files are written by a python script from a template diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 466b4cef..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -exclude *.txt -exclude MANIFEST.in -recursive-include *.pxi *.pxd *.pyx *.so -include ecoscope/contrib/legend.txt \ No newline at end of file diff --git a/ecoscope/version.py b/ecoscope/version.py deleted file mode 100644 index 008aaa97..00000000 --- a/ecoscope/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = "1.7.3" diff --git a/pyproject.toml b/pyproject.toml index 916aee07..7da5763d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,67 @@ [build-system] -requires = ["setuptools", "wheel", "cython"] +requires = ["setuptools>=45", "setuptools_scm[toml]>=6.2"] + +[project] +name="ecoscope" +dynamic = ["version"] +description="Standard Analytical Reporting Framework for Conservation" +readme = "README.rst" +authors = [ + { name = "Jake Wall", email = "walljcg@gmail.com" } +] +license = {file = "LICENSE"} +classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.4", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", +] +dependencies = [ + "affine", + "astroplan", + "backoff", + "datashader", + "earthengine-api", + "earthranger-client", + "folium", + "geopandas<=0.14.2", + "igraph", + "ipywidgets", + "kaleido", + "mapclassify", + "matplotlib", + "networkx", + "numba", + "plotly", + "pyarrow", + "pyproj", + "rasterio", + "scipy", + "scikit-image", + "scikit-learn", + "selenium", + "tqdm", + "xyzservices", +] + +[project.urls] +Homepage = "https://ecoscope.io" +Repository = "https://github.com/wildlife-dynamics/ecoscope" +Tracker = "https://github.com/wildlife-dynamics/ecoscope/issues" + +[project.optional-dependencies] +test = [ + "pytest", + "pytest-cov", + "pytest-mock", + "pytest-reportlog", +] [tool.pytest.ini_options] testpaths = "tests" @@ -30,4 +92,20 @@ exclude = ''' [tool.coverage.run] source = ['ecoscope'] -omit = ['ecoscope/contrib/*'] \ No newline at end of file +omit = ['ecoscope/contrib/*'] + +[tool.setuptools] +packages=[ + "ecoscope", + "ecoscope.analysis", + "ecoscope.analysis.UD", + "ecoscope.base", + "ecoscope.contrib", + "ecoscope.io", + "ecoscope.mapping", + "ecoscope.plotting", + ] + +[tool.setuptools_scm] +write_to = "ecoscope/_version.py" +write_to_template = "__version__ = '{version}'" diff --git a/setup.py b/setup.py deleted file mode 100644 index 1a3d148b..00000000 --- a/setup.py +++ /dev/null @@ -1,81 +0,0 @@ -import os -import re - -from setuptools import setup - -version_file = open("ecoscope/version.py").read() -version_data = dict(re.findall(r'__([a-z]+)__\s*=\s*"([^"]+)"', version_file)) - -try: - descr = open(os.path.join(os.path.dirname(__file__), "README.rst")).read() -except IOError: - descr = "" - -dependencies = [ - "affine", - "astroplan", - "backoff", - "datashader", - "earthengine-api", - "earthranger-client", - "folium", - "geopandas<=0.14.2", - "igraph", - "ipywidgets", - "kaleido", - "mapclassify", - "matplotlib", - "networkx", - "numba", - "plotly", - "pyarrow", - "pyproj", - "pytest", - "pytest-cov", - "pytest-mock", - "pytest-reportlog", - "rasterio", - "scipy", - "scikit-image", - "scikit-learn", - "selenium", - "tqdm", - "xyzservices", -] - -setup( - name="ecoscope", - version=version_data["version"], - description="Standard Analytical Reporting Framework for Conservation", - long_description=descr, - url="http://github.com/wildlife-dynamics/ecoscope", - author="Jake Wall", - author_email="walljcg@gmail.com", - license="MIT", - packages=[ - "ecoscope", - "ecoscope.analysis", - "ecoscope.analysis.UD", - "ecoscope.base", - "ecoscope.contrib", - "ecoscope.io", - "ecoscope.mapping", - "ecoscope.plotting", - ], - platforms="Posix; MacOS X; Windows", - install_requires=dependencies, - zip_safe=False, - classifiers=[ - "License :: OSI Approved :: BSD License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - ], - include_package_data=True, -)