Skip to content

Commit

Permalink
switch to hatch and pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
eimrek committed May 28, 2024
1 parent 027a7d3 commit f7b90d5
Show file tree
Hide file tree
Showing 10 changed files with 57 additions and 183 deletions.
File renamed without changes.
5 changes: 0 additions & 5 deletions MANIFEST.in

This file was deleted.

20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Voilà template for Materials Cloud

[![PyPI - Version](https://img.shields.io/pypi/v/voila-materialscloud-template?color=4CC61E)](https://pypi.org/project/voila-materialscloud-template/)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/materialscloud-org/voila-materialscloud-template/main?urlpath=%2Fvoila%2Frender%2Fexample-notebooks%2Fexample.ipynb)

This is the Voilà template for Materials Cloud, implements the standard header and CSS.

Three templates are provided:
* `materialscloud-tool` - highlights the [WORK](https://www.materialscloud.org/work)/Tools section in the header/breadcrumbs.
* `materialscloud-discover` - highlights the [DISCOVER](https://www.materialscloud.org/discover) section in the header/breadcrumbs.
* `materialscloud-iframe` - just adds a simple "Hosted on Materials Cloud" note at the bottom.

- `materialscloud-tool` - highlights the [WORK](https://www.materialscloud.org/work)/Tools section in the header/breadcrumbs.
- `materialscloud-discover` - highlights the [DISCOVER](https://www.materialscloud.org/discover) section in the header/breadcrumbs.
- `materialscloud-iframe` - just adds a simple "Hosted on Materials Cloud" note at the bottom.

## Installation

Expand All @@ -24,6 +26,7 @@ The main way is to use the `voila --template` option, e.g.:
```bash
voila --template=materialscloud-tool example.ipynb
```

Alternatively, you can write a `voila.json` file containing

```json
Expand Down Expand Up @@ -51,7 +54,7 @@ Option 1:
pip install -e .[dev]
```

Note: this will copy the templates to the jupyter folder, and they need to be modified directly there or re-copied if new tests are required.
Note: this will copy the templates to the jupyter folder, and they need to be modified directly there or re-copied for changes to take effect.

Option 2:

Expand All @@ -69,10 +72,11 @@ Note: maybe there is an easier setup, e.g. with live-reload or similar.
### Making a new release

To release a new version, just make a new release on Github with the correct version tag, without updating any versions manually. This will start the GitHub action that will
* update version numbers in the repo and commits it;
* tags this new commit with the version, overwriting the tag that was made by the Github release;
* pushes commit & tag to Github;
* publishes new version on PYPI.

- update version numbers in the repo and commits it;
- tags this new commit with the version, overwriting the tag that was made by the Github release;
- pushes commit & tag to Github;
- publishes new version on PYPI.

## License

Expand Down
85 changes: 0 additions & 85 deletions copy_voila_template.py

This file was deleted.

7 changes: 2 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ FROM python:3.9

WORKDIR /home/voila

COPY requirements.txt .
RUN pip install -r requirements.txt

COPY requirements_dev.txt .
RUN pip install -r requirements_dev.txt
COPY pyproject.toml LICENSE.txt README.md ./
RUN pip install .[dev]

EXPOSE 8866
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[build-system]
requires = ["hatchling >=1.5"]
build-backend = "hatchling.build"

[project]
name = "voila-materialscloud-template"
version = "0.4.1"
description = 'Voilà template for Materials Cloud.'
authors = [{ name = "The Materials Cloud team" }]
urls = { Source = 'https://github.com/materialscloud-org/voila-materialscloud-template' }
license = { file = 'LICENSE.txt' }
readme = "README.md"
keywords = ['voila', 'jupyter', 'materialscloud']
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
]

requires-python = ">=3.8"
dependencies = ["voila~=0.4.4", "jupyter-core~=5.3.1"]

[project.optional-dependencies]
dev = [
"invoke~=2.2",
"ipywidgets~=8.1",
"pylint~=2.17",
"jupyterlab~=4.0",
"widget-periodictable~=4.1",
]

[tool.hatch.build.targets.sdist]
artifacts = ["share"]

[tool.hatch.build.targets.wheel]
packages = ["share"]

# copy the templates to the correct location
[tool.hatch.build.targets.wheel.shared-data]
"share/jupyter" = "share/jupyter"
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

5 changes: 0 additions & 5 deletions requirements_dev.txt

This file was deleted.

8 changes: 0 additions & 8 deletions setup.cfg

This file was deleted.

65 changes: 0 additions & 65 deletions setup.py

This file was deleted.

0 comments on commit f7b90d5

Please sign in to comment.