diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..40bc37b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,23 @@ +name: test + +on: [push, pull_request] + +jobs: + test: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + version: ["3.10", "3.11"] + runs-on: ${{matrix.os}} + defaults: + run: + working-directory: ${{github.workspace}} + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: ${{matrix.version}} + - run: python -m pip install --upgrade pip build + - run: python -m build . + - run: python -m pip install '.[tests]' + - run: pytest test/ diff --git a/.gitignore b/.gitignore index af19c75..d44860e 100644 --- a/.gitignore +++ b/.gitignore @@ -127,15 +127,9 @@ dmypy.json # Pyre type checker .pyre/ -docs/.DS_Store -notebooks/.DS_Store -src/spotRiver/data/.DS_Store -src/spotRiver/.DS_Store -src/spotRiver/fun/.DS_Store -test/.DS_Store -src/.DS_Store -spotRiver.code-workspace .DS_Store +spotRiver.code-workspace notebooks/data/opm_2001-2020.csv notebooks/opm.csv notebooks/opm_cat.csv +src/spotRiver/_version.py diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index a00c089..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,4 +0,0 @@ -include src/spotRiver/data/*.rst -include src/spotRiver/data/*.tar -include src/spotRiver/data/*.c -include src/spotRiver/data/*.csv diff --git a/pyproject.toml b/pyproject.toml index c8608e6..1a76846 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,12 @@ [build-system] -requires = ["scipy", - "setuptools>=61.0", - "graphviz", - "numpy", - "scikit-learn", - "matplotlib"] +requires = [ + "setuptools>=61.0", + "setuptools_scm[toml]", +] build-backend = "setuptools.build_meta" [project] name = "spotRiver" -version = "0.0.10" authors = [ { name="T. Bartz-Beielstein", email="tbb@bartzundbartz.de" } ] @@ -21,19 +18,20 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Operating System :: OS Independent", ] -# PEP 621 dependencies declaration -# adapt to your dependencies manager dependencies = [ - "mkdocstrings-python" + "numpy", + "river >= 0.15.0", + "pytest [tests]", + "spotPython [docs] >= 0.0.2", ] +dynamic=["version"] [project.urls] "Homepage" = "https://www.spotseven.de" +Issues = "https://github.com/sequential-parameter-optimization/spotRiver/issues" +Repository = "https://github.com/sequential-parameter-optimization/spotRiver" [tool.setuptools] -# ... -# By default, include-package-data is true in pyproject.toml, so you do -# NOT have to specify this line. include-package-data = true [tool.setuptools.packages.find] @@ -43,3 +41,10 @@ where = ["src"] line-length = 120 target-version = ["py310"] +[tool.setuptools_scm] +write_to = "src/spotRiver/_version.py" + +[tool.pytest.ini_options] +addopts = [ + "--import-mode=importlib", +] diff --git a/src/spotRiver/__init__.py b/src/spotRiver/__init__.py new file mode 100644 index 0000000..9ee1e88 --- /dev/null +++ b/src/spotRiver/__init__.py @@ -0,0 +1,4 @@ +try: + from ._version import __version__ +except ModuleNotFoundError: + __version__ = "0.0.0dev" diff --git a/src/spotRiver/data/synth/.DS_Store b/src/spotRiver/data/synth/.DS_Store deleted file mode 100644 index a292f56..0000000 Binary files a/src/spotRiver/data/synth/.DS_Store and /dev/null differ diff --git a/src/spotRiver/fun/__init__.py b/src/spotRiver/fun/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/spotRiver/utils/__init__.py b/src/spotRiver/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/test/test_features.py b/test/test_features.py index ef15fc4..546b048 100644 --- a/test/test_features.py +++ b/test/test_features.py @@ -1,5 +1,5 @@ from spotRiver import data -from spotPython.utils.features import get_hour_distances, get_month_distances, get_ordinal_date, get_weekday_distances +from spotRiver.utils.features import get_hour_distances, get_month_distances, get_ordinal_date, get_weekday_distances def test_features(): @@ -13,4 +13,4 @@ def test_features(): assert(get_hour_distances(x)["0"] == 1.0) assert(get_weekday_distances(x)["Saturday"] == 1.0) assert(get_month_distances(x)["January"] == 1.0) - break \ No newline at end of file + break