diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..039b2d0
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,32 @@
+name: workflow
+
+on:
+ workflow_dispatch:
+ push:
+ branches:
+ - main
+ pull_request:
+
+jobs:
+ test:
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash -l {0}
+
+ steps:
+ - name: checkout
+ uses: actions/checkout@v2
+
+ - name: install package
+ run: pip install .
+
+ # TODO move to pyproject.toml
+ - name: install test dependencies
+ run: pip install pycodestyle
+
+ - name: style
+ run: pycodestyle src/blaupause
+
+ - name: test
+ run: pytest
diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml
deleted file mode 100644
index 1e1f073..0000000
--- a/.github/workflows/workflow.yml
+++ /dev/null
@@ -1,35 +0,0 @@
-name: workflow
-on: [push]
-
-jobs:
- workflow:
- runs-on: ubuntu-latest
- defaults:
- run:
- shell: bash -l {0}
-
- steps:
- - name: home
- run: |
- echo $HOME
- ls -la
- - name: checkout
- uses: actions/checkout@v2
-
- - name: Set env
- run: echo "TEST=$GITHUB_WORKSPACE/script/hello.sh" >> $GITHUB_ENV
- - name: checkout branch
- run: |
- if git rev-parse --quiet --verify feature; then git checkout feature; fi
- - name: test branch
- run: git branch
- - name: test-env
- run: |
- echo pwd
- echo $GITHUB_WORKSPACE
- echo $TEST
- - name: run hello script
- run:
- bash $TEST
- - name: read
- run: ls -la
diff --git a/.readthedocs.yml b/.readthedocs.yml
deleted file mode 100644
index 0723e1a..0000000
--- a/.readthedocs.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-build:
- image: latest
-
-python:
- version: 3.8
- install:
- - requirements: docs/requirements.txt
- - method: pip
- path: .
-
-formats: []
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 8a4d0f8..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,7 +0,0 @@
-sudo: required
-
-services:
- - docker
-
-script:
- - make travis-build
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index 04f196a..0000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include README.md
-include LICENSE
diff --git a/Makefile b/Makefile
deleted file mode 100644
index f18eec7..0000000
--- a/Makefile
+++ /dev/null
@@ -1,53 +0,0 @@
-PROJECT=blaupause
-IPYNBPATH=docs/ipynb/*.ipynb
-CODECOVTOKEN=1a84bf68-02e9-4313-b11b-f08df6ed7235
-PYTHON?=python3
-
-test:
- $(PYTHON) -m pytest
-
-test-test:
- $(PYTHON) -c "import sys; import $(PROJECT); sys.exit($(PROJECT).test())"
-
-test-coverage:
- $(PYTHON) -m pytest -v --cov=$(PROJECT) --cov-config .coveragerc
-
-test-docs:
- $(PYTHON) -m pytest -v --doctest-modules --ignore=$(PROJECT)/tests $(PROJECT)
-
-test-ipynb:
- $(PYTHON) -m pytest -v --nbval $(IPYNBPATH)
-
-test-pycodestyle:
- $(PYTHON) -m pycodestyle --filename=*.py .
-
-test-all: test-test test-coverage test-docs test-ipynb test-pycodestyle
-
-upload-coverage: SHELL:=/bin/bash
-upload-coverage:
- bash <(curl -s https://codecov.io/bash) -t $(CODECOVTOKEN)
-
-travis-build: SHELL:=/bin/bash
-travis-build:
- ci_env=`bash <(curl -s https://codecov.io/env)`
- docker build -f docker/Dockerfile -t dockertestimage .
- docker run -e ci_env -ti -d --name testcontainer dockertestimage
- docker exec testcontainer make test-all
- docker exec testcontainer make upload-coverage
- docker stop testcontainer
- docker rm testcontainer
-
-test-docker:
- docker build -f docker/Dockerfile -t dockertestimage .
- docker run -ti -d --name testcontainer dockertestimage
- docker exec testcontainer find . -name '*.pyc' -delete
- docker exec testcontainer make test-all
- docker stop testcontainer
- docker rm testcontainer
-
-build-dists:
- rm -rf dist/
- $(PYTHON) setup.py sdist bdist_wheel
-
-release: build-dists
- twine upload dist/*
diff --git a/README-old.md b/README-old.md
new file mode 100644
index 0000000..d4b697c
--- /dev/null
+++ b/README-old.md
@@ -0,0 +1,63 @@
+# Blaupause - Python package template
+Martin Lang1 and Marijan Beg1
+
+1 *Faculty of Engineering and Physical Sciences, University of Southampton, Southampton SO17 1BJ, United Kingdom*
+
+| Description | Badge |
+| --- | --- |
+| Builds | [](https://ci.appveyor.com/project/lang-m/blaupause/branch/main)|
+| | [](https://travis-ci.org/lang-m/blaupause) |
+| Coverage | [](https://codecov.io/gh/lang-m/blaupause) |
+| Documentation | [](https://blaupause.readthedocs.io/en/latest/?badge=latest)|
+| Binder | [](https://mybinder.org/v2/gh/lang-m/blaupause/main?filepath=docs%2Fipynb%2Findex.ipynb) |
+| License | [](https://opensource.org/licenses/BSD-3-Clause) |
+| DOI | [](https://doi.org/10.5281/zenodo.4327500) |
+
+## About
+
+A sample Python-based package that can be used a tutorial for setting up a project.
+
+Demonstrated are:
+- Testing with pytest/doctests
+- continuous integration
+ - Travis
+ - Appveyor
+ - soon: GitHub actions
+- code coverage
+- docker
+- make files
+- packaging
+- documentation
+- licensing
+
+It is available on Windows, MacOS, and Linux. It requires Python 3.8+.
+
+## Documentation
+
+APIs and tutorials are available in documentation. To access them, use the documentation badge in the table above.
+
+## Installation, testing, and upgrade
+
+We recommend installation using `conda` package manager. Instructions can be found in the documentation.
+
+## Binder
+
+This package can be used in the cloud via Binder. To access Binder, use the Binder badge in the table above.
+
+## Support
+
+If you require support, have questions, want to report a bug, or want to suggest an improvement, please raise an issue in this repository.
+
+## License
+
+Licensed under the BSD 3-Clause "New" or "Revised" License. For details, please refer to the [LICENSE](LICENSE) file.
+
+## How to cite
+
+Please cite this package as:
+
+Martin Lang and Marijan Beg. Blaupause - Python package template. Zenodo. DOI: [10.5281/zenodo.4327500](http://doi.org/10.5281/zenodo.4327500) (2020).
+
+## Acknowledgements
+
+- EPSRC Programme grant on [Skyrmionics](http://www.skyrmions.ac.uk) (EP/N032128/1).
diff --git a/README.md b/README.md
index d4b697c..bc80a80 100644
--- a/README.md
+++ b/README.md
@@ -1,63 +1,8 @@
# Blaupause - Python package template
-Martin Lang1 and Marijan Beg1
-
-1 *Faculty of Engineering and Physical Sciences, University of Southampton, Southampton SO17 1BJ, United Kingdom*
-
-| Description | Badge |
-| --- | --- |
-| Builds | [](https://ci.appveyor.com/project/lang-m/blaupause/branch/main)|
-| | [](https://travis-ci.org/lang-m/blaupause) |
-| Coverage | [](https://codecov.io/gh/lang-m/blaupause) |
-| Documentation | [](https://blaupause.readthedocs.io/en/latest/?badge=latest)|
-| Binder | [](https://mybinder.org/v2/gh/lang-m/blaupause/main?filepath=docs%2Fipynb%2Findex.ipynb) |
-| License | [](https://opensource.org/licenses/BSD-3-Clause) |
-| DOI | [](https://doi.org/10.5281/zenodo.4327500) |
-
-## About
A sample Python-based package that can be used a tutorial for setting up a project.
-Demonstrated are:
-- Testing with pytest/doctests
-- continuous integration
- - Travis
- - Appveyor
- - soon: GitHub actions
-- code coverage
-- docker
-- make files
-- packaging
-- documentation
-- licensing
-
-It is available on Windows, MacOS, and Linux. It requires Python 3.8+.
-
-## Documentation
-
-APIs and tutorials are available in documentation. To access them, use the documentation badge in the table above.
-
-## Installation, testing, and upgrade
-
-We recommend installation using `conda` package manager. Instructions can be found in the documentation.
-
-## Binder
-
-This package can be used in the cloud via Binder. To access Binder, use the Binder badge in the table above.
-
-## Support
-
-If you require support, have questions, want to report a bug, or want to suggest an improvement, please raise an issue in this repository.
## License
Licensed under the BSD 3-Clause "New" or "Revised" License. For details, please refer to the [LICENSE](LICENSE) file.
-
-## How to cite
-
-Please cite this package as:
-
-Martin Lang and Marijan Beg. Blaupause - Python package template. Zenodo. DOI: [10.5281/zenodo.4327500](http://doi.org/10.5281/zenodo.4327500) (2020).
-
-## Acknowledgements
-
-- EPSRC Programme grant on [Skyrmionics](http://www.skyrmions.ac.uk) (EP/N032128/1).
diff --git a/appveyor.yml b/appveyor.yml
deleted file mode 100644
index 4a44fa3..0000000
--- a/appveyor.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-environment:
- matrix:
- - PYTHON_VERSION: 3.8
- MINICONDA: C:\Miniconda3-x64
-
-platform:
- - x64
-
-build: false
-
-install:
- - "set PATH=%MINICONDA%;%MINICONDA%\\Scripts;%PATH%"
- - conda config --set always_yes yes --set changeps1 no
- - conda update -q conda
- - "conda create -q -n test-environment python=%PYTHON_VERSION%"
- - activate test-environment
- - python -m pip install --upgrade pip nbval pycodestyle .
-
-test_script:
- - python -m pytest -v
- - python -m pytest -v --doctest-modules --ignore=blaupause/tests blaupause
- - python -m pycodestyle --filename=*.py .
- # - python -c "import discretisedfield as df; import sys; sys.exit(df.test())"
- # - python -m pytest -v --doctest-modules --ignore=discretisedfield\tests discretisedfield
- # - python -m pytest -v --nbval docs\ipynb\
- # - python -m pycodestyle --filename=*.py .
diff --git a/docker/Dockerfile b/docker/Dockerfile
deleted file mode 100644
index 2cc933b..0000000
--- a/docker/Dockerfile
+++ /dev/null
@@ -1,9 +0,0 @@
-FROM ubuntu:20.04
-
-RUN apt update -y
-RUN apt install -y python3-pip curl git
-RUN python3 -m pip install --upgrade pip pytest-cov nbval pycodestyle
-
-COPY . /usr/local/blaupause/
-WORKDIR /usr/local/blaupause
-RUN python3 -m pip install .
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 0000000..44336b1
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,26 @@
+[build-system]
+requires = ["hatchling"]
+build-backend = "hatchling.build"
+
+
+[project]
+name = "blaupause"
+version = "0.1.3"
+dependencies = [
+ "pytest",
+]
+requires-python = ">=3.8"
+
+authors = [
+ {name="Martin Lang"},
+ {name="Marijan Beg"},
+]
+description = "Example package used as a template for setting up Python packages/repositories."
+readme = "README.md"
+license = "BSD-3-Clause"
+license-files = ["LICENSE"]
+
+
+[project.urls]
+Homepage = "https://github.com/lang-m/blaupause"
+# Documentation
diff --git a/script/hello.sh b/script/hello.sh
deleted file mode 100644
index 5939c96..0000000
--- a/script/hello.sh
+++ /dev/null
@@ -1 +0,0 @@
-echo "Hello"
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 1d24652..0000000
--- a/setup.py
+++ /dev/null
@@ -1,30 +0,0 @@
-import setuptools
-
-with open('README.md', encoding='utf-8') as f:
- long_description = f.read()
-
-setuptools.setup(
- name='blaupause',
- version='0.1.3',
- description=('Example package used as a template for setting up '
- 'Python packages/repositories.'),
- # these two lines allow using markdown README
- long_description=long_description,
- long_description_content_type='text/markdown',
- # url='https://ubermag.github.io',
- author='Martin Lang and Marijan Beg',
- packages=setuptools.find_packages(),
- include_package_data=True,
- python_requires='>=3.8',
- install_requires=['pytest>=6.0.0'],
- classifiers=['Development Status :: 3 - Alpha',
- 'Intended Audience :: Education',
- 'Intended Audience :: Developers',
- 'License :: OSI Approved :: BSD License',
- 'Natural Language :: English',
- 'Operating System :: MacOS',
- 'Operating System :: Microsoft :: Windows',
- 'Operating System :: Unix',
- 'Programming Language :: Python :: 3 :: Only',
- ]
-)
diff --git a/blaupause/__init__.py b/src/blaupause/__init__.py
similarity index 77%
rename from blaupause/__init__.py
rename to src/blaupause/__init__.py
index 40ad873..e4fbad7 100644
--- a/blaupause/__init__.py
+++ b/src/blaupause/__init__.py
@@ -6,12 +6,12 @@
'''
import pytest
+import importlib.metadata
import pkg_resources
from .functions import add, subtract, multiply
from .blueprint import Blueprint
-__version__ = pkg_resources.get_distribution(__name__).version
-__dependencies__ = pkg_resources.require(__name__)
+__version__ = importlib.metadata.version(__package__)
def test():
@@ -19,5 +19,6 @@ def test():
'''
return pytest.main(['-v', '--pyargs', 'blaupause']) # pragma: no cover
+
if __name__ == '__main__':
main()
diff --git a/blaupause/__main__.py b/src/blaupause/__main__.py
similarity index 91%
rename from blaupause/__main__.py
rename to src/blaupause/__main__.py
index 17b915f..3a167f4 100644
--- a/blaupause/__main__.py
+++ b/src/blaupause/__main__.py
@@ -1,12 +1,14 @@
import argparse
+
def main():
args = argparse.ArgumentParser()
args.add_argument('--test')
ca = args.parse_args()
print('executed as "python -m blaupause"')
print(ca)
- print('DONE')
+ print('DONE')
+
if __name__ == '__main__':
main()
diff --git a/blaupause/blueprint.py b/src/blaupause/blueprint.py
similarity index 100%
rename from blaupause/blueprint.py
rename to src/blaupause/blueprint.py
diff --git a/blaupause/functions.py b/src/blaupause/functions.py
similarity index 100%
rename from blaupause/functions.py
rename to src/blaupause/functions.py
diff --git a/blaupause/tests/__init__.py b/src/blaupause/tests/__init__.py
similarity index 100%
rename from blaupause/tests/__init__.py
rename to src/blaupause/tests/__init__.py
diff --git a/blaupause/tests/test_function.py b/src/blaupause/tests/test_function.py
similarity index 100%
rename from blaupause/tests/test_function.py
rename to src/blaupause/tests/test_function.py