diff --git a/.gitignore b/.gitignore index bbeca65..c5697d4 100644 --- a/.gitignore +++ b/.gitignore @@ -129,4 +129,7 @@ dmypy.json .pyre/ # macOS -.DS_Store \ No newline at end of file +.DS_Store + +# Poetry +poetry.lock diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9b38853 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,7 @@ +{ + "python.testing.pytestArgs": [ + "tests" + ], + "python.testing.unittestEnabled": false, + "python.testing.pytestEnabled": true +} \ No newline at end of file diff --git a/README.md b/README.md index d0ef8d5..e869716 100644 --- a/README.md +++ b/README.md @@ -78,3 +78,10 @@ The staging process will also output a summary CSV file with one row for each ti - If the deduplication method specified in the configuration is `footprints`, the footprint file(s) are provided with a structure that follows the [docs](https://github.com/PermafrostDiscoveryGateway/viz-staging/blob/main/docs/footprints.md). - In order for logging to work properly, the node running the script that uses this package has a `/tmp` directory so the `log.log` file can populate there. +## Development + +Build and test using poetry and pytest. + +- To build, run `poetry build` +- To test, run `pytest` from the root of the package directory +- VS Code configuration is setup to configure tests as well diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..60d2432 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,40 @@ +[tool.poetry] +name = "pdgstaging" +version = "0.9.1" +description = "Geospatial data tiling workflow" +authors = [ + "Robyn Thiessen-Bock ", + "Juliet Cohen ", + "Lauren Walker ", + "Matthew B. Jones ", +] +license = 'Apache Software License 2.0' +readme = "README.md" +repository = 'https://github.com/PermafrostDiscoveryGateway/viz-staging' +classifiers=[ + 'Development Status :: 2 - Pre-Alpha', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: Apache Software License', + 'Natural Language :: English', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.9', +] + +[tool.poetry.dependencies] +python = ">=3.9" +numpy = ">=1.2" +pandas = ">=1.4, < 2.0" +shapely = ">= 2, < 3.0" +geopandas = ">= 0.12.2, < 1.0" +morecantile = ">= 3.1, < 4.0" +Rtree = ">= 0.9, < 1.0" +filelock = ">= 3.6, < 4.0" +coloraide = ">= 0.10, < 1" +colormaps = "== 0.4.0" + +[tool.poetry.group.dev.dependencies] +pytest = ">=7" + +[build-system] +requires = ["poetry-core"] +build-backend = "poetry.core.masonry.api" diff --git a/setup.py b/setup.py deleted file mode 100644 index 02a9381..0000000 --- a/setup.py +++ /dev/null @@ -1,37 +0,0 @@ -from setuptools import setup - -with open('README.md', 'r') as fh: - long_description = fh.read() - -setup( - author='Robyn Thiessen-Bock, Juliet Cohen', - author_email='thiessenbock@nceas.ucsb.edu, jcohen@nceas.ucsb.edu', - name='pdgstaging', - version='0.9.0', - description='PDG Visualization staging pipeline', - long_description=long_description, - long_description_content_type='text/markdown', - url='https://github.com/PermafrostDiscoveryGateway/viz-staging', - packages=['pdgstaging'], - install_requires=[ - 'numpy >= 1.2, < 2.0', - 'pandas >= 1.4, < 2.0', - 'shapely >= 2, < 3.0', - 'geopandas >= 0.12.2, < 1.0', - 'morecantile >= 3.1, < 4.0', - 'Rtree >= 0.9, < 1.0', - 'filelock >= 3.6, < 4.0', - 'coloraide >= 0.10, < 1', - 'colormaps == 0.4.0' - ], - python_requires='>=3.9, <4.0', - classifiers=[ - 'Development Status :: 2 - Pre-Alpha', - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Natural Language :: English', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.9', - ], - license='Apache Software License 2.0', -) diff --git a/tests/test_loaddata.py b/tests/test_loaddata.py new file mode 100644 index 0000000..986b9e2 --- /dev/null +++ b/tests/test_loaddata.py @@ -0,0 +1,12 @@ +from pandas import DataFrame + +def test_init(): + """Initialize tests and show they are working. + """ + assert 1 == 1 + +def test_load_data(): + """Load example testing data for staging tests. + """ + df = DataFrame( dict( x=[1,2,3], y=[4,5,6] ) ) + assert df is not None