Skip to content

Various improvements #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-22.04
env:
# Directory that will be published on github pages
PUBLISH_DIR: ./docs/_build/html

steps:
- uses: actions/checkout@v3

Expand All @@ -17,12 +20,22 @@ jobs:
python-version: "3.10"

- name: Install dependencies
run: python -m pip install ".[docs]"
run: python -m pip install ".[test,docs]"

- name: Build docs
run: make doc

- name: Copy Dockerfile into gh-pages
run: cp Dockerfile ${PUBLISH_DIR}

- name: Add coverage report to github pages
run: |
python -m pytest --cov=mypackage test
python -m coverage html
cp -r htmlcov ${PUBLISH_DIR}

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/_build/html
publish_dir: ${PUBLISH_DIR}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN apt-get purge -y python3-setuptools
# Install mypackage
WORKDIR /tmp/
RUN git clone https://github.com/jorgensd/reproducibility && \
pip3 install ./reproducibility[docs]
pip install ./reproducibility[docs]

RUN rm -rf /tmp

Expand Down
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,26 @@
# Reproducible workflow for researchers
[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://jorgensd.github.io/reproducibility)
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)

This repository is a template for how to set up a reproducible python environment with GitHub.

## Badges

[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jorgensd/reproducibility/gh-pages?labpath=_sources)

To get the `Launch Binder` badge, go to: [https://mybinder.org/](https://mybinder.org/) and fill in (specifics for this repo in brackets):
- Your Github repository (https://github.com/jorgensd/reproducibility)
- Git ref (`gh-pages`, see: [How to create github pages](#ghpages))
- Path to notebook file (`_sources`, as generated by `jupyter-book`, see [Jupyter-book](#jupyterbook))

Then press `Launch`, and then `Expand to see the text below, paste it into your README to show a binder badge` and copy the markdown code. If you render the README.md file as plaintext, you can see all the settings explicitly in the image link

[![Jupyter Book Badge](https://jupyterbook.org/badge.svg)](https://jorgensd.github.io/reproducibility)

Replace link in image (https://jorgensd.github.io/reproducibility) with your [Github pages url](#ghpages)

![MIT License](https://img.shields.io/github/license/jorgensd/reproducibility)

Replace `username/repo` in image link with appropriate user/respository.

## Python-packaging

To be able to create a python package, we need a folder with the name of the package (in this repository it is called `mypackage`, located under `src/mypackage`), and a `pyproject.toml` file.
Expand All @@ -24,4 +41,13 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for ways to get started.

A good idea is to look at the [issue tracker](https://github.com/jorgensd/reproducibility/issues) and see if you can resolve any open issues. A list of good first issues can be found [here](https://github.com/jorgensd/reproducibility/contribute)

If you find a bug in the source code, please [open an issue](https://github.com/jorgensd/reproducibility/issues/new/choose).
If you find a bug in the source code, please [open an issue](https://github.com/jorgensd/reproducibility/issues/new).


## <a id="ghpages"></a> Auto-publish to Github Pages

Add text

## <a id="jupyterbook"></a> Jupyter-book

Add text