Skip to content

Commit e53b5c0

Browse files
committed
Init project
1 parent e6fe50d commit e53b5c0

27 files changed

+845
-5
lines changed

.flake8

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# flake8 does not support pyproject.toml, see:
2+
# https://github.com/PyCQA/flake8/issues/234
3+
[flake8]
4+
exclude = __init__.py, _build
5+
max-line-length = 120

.github/workflows/build_docs.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Deploy static content to Pages
3+
4+
on:
5+
# Runs on pushes targeting the default branch
6+
push:
7+
branches:
8+
- "**"
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
13+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
14+
permissions:
15+
contents: read
16+
pages: write
17+
id-token: write
18+
19+
# Allow one concurrent deployment
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: true
23+
24+
env:
25+
# Directory that will be published on github pages
26+
PUBLISH_DIR: ./_build/html
27+
28+
jobs:
29+
30+
build:
31+
runs-on: ubuntu-22.04
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v3
36+
37+
- name: Set up Python ${{ matrix.python-version }}
38+
uses: actions/setup-python@v4
39+
with:
40+
python-version: "3.10"
41+
42+
- name: Install dependencies
43+
run: python3 -m pip install ".[docs]"
44+
45+
- name: Build docs
46+
run: jupyter book build -W .
47+
48+
- name: Upload artifact
49+
uses: actions/upload-pages-artifact@v1
50+
with:
51+
path: ${{ env.PUBLISH_DIR }}
52+
53+
# Single deploy job since we're just deploying
54+
deploy:
55+
if: github.ref == 'refs/heads/main'
56+
needs: build
57+
environment:
58+
name: github-pages
59+
url: ${{ steps.deployment.outputs.page_url }}
60+
61+
runs-on: ubuntu-latest
62+
63+
steps:
64+
- name: Checkout
65+
uses: actions/checkout@v3
66+
67+
- name: Setup Pages
68+
uses: actions/configure-pages@v2
69+
70+
71+
- name: Deploy to GitHub Pages
72+
id: deployment
73+
uses: actions/deploy-pages@v1
+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Check formatting
2+
3+
on:
4+
push:
5+
# The CI is executed on every push on every branch
6+
branches:
7+
- main
8+
pull_request:
9+
# The CI is executed on every pull request to the main branch
10+
branches:
11+
- main
12+
13+
schedule:
14+
# The CI is executed every day at 8am
15+
- cron: "0 8 * * *"
16+
17+
jobs:
18+
check-code:
19+
runs-on: ubuntu-22.04
20+
21+
strategy:
22+
matrix:
23+
python-version: ["3.8", "3.9", "3.10"]
24+
25+
steps:
26+
# This action sets the current path to the root of your github repo
27+
- uses: actions/checkout@v3
28+
29+
- name: Set up Python ${{ matrix.python-version }}
30+
uses: actions/setup-python@v4
31+
with:
32+
python-version: ${{ matrix.python-version }}
33+
34+
- name: Install code
35+
run: python -m pip install .[dev]
36+
37+
- name: Flake8 code
38+
run: python -m flake8 -v
39+
40+
- name: Mypy check
41+
run: python -m mypy -v

.github/workflows/docker-image.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
6+
name: Create and publish a Docker image
7+
8+
on:
9+
push:
10+
branches:
11+
- "!*"
12+
tags:
13+
- "v*"
14+
15+
env:
16+
REGISTRY: ghcr.io
17+
IMAGE_NAME: ${{ github.repository }}
18+
19+
jobs:
20+
build-and-push-image:
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
packages: write
25+
26+
steps:
27+
- name: Checkout repository
28+
uses: actions/checkout@v3
29+
30+
- name: Set up QEMU
31+
uses: docker/setup-qemu-action@v2
32+
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v2
35+
36+
- name: Log in to the Container registry
37+
uses: docker/login-action@v2
38+
with:
39+
registry: ${{ env.REGISTRY }}
40+
username: ${{ github.actor }}
41+
password: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Extract metadata (tags, labels) for Docker
44+
id: meta
45+
uses: docker/metadata-action@v4
46+
with:
47+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
48+
49+
- name: Build and push Docker image
50+
uses: docker/build-push-action@v3
51+
with:
52+
context: .
53+
push: true
54+
platforms: linux/amd64,linux/arm64
55+
tags: ${{ steps.meta.outputs.tags }}
56+
labels: ${{ steps.meta.outputs.labels }}
57+
file: docker/Dockerfile
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Test package
2+
3+
on:
4+
push:
5+
# The CI is executed on every push on every branch
6+
branches:
7+
- main
8+
pull_request:
9+
# The CI is executed on every pull request to the main branch
10+
branches:
11+
- main
12+
13+
schedule:
14+
# The CI is executed every day at 8am
15+
- cron: "0 8 * * *"
16+
jobs:
17+
18+
test-code:
19+
# This code depends on the result of check-code
20+
runs-on: ${{ matrix.os }}
21+
22+
strategy:
23+
matrix:
24+
os: [ubuntu-22.04, windows-latest, macos-12]
25+
python-version: ["3.8", "3.9", "3.10"]
26+
27+
steps:
28+
- name: Set up Python ${{ matrix.python-version }}
29+
uses: actions/setup-python@v4
30+
with:
31+
python-version: ${{ matrix.python-version }}
32+
33+
- uses: actions/checkout@v3
34+
35+
- name: Install package
36+
run: pip install .[test]
37+
38+
- name: Run tests
39+
run: python -m pytest
40+
41+
- name: Upload coverage report as artifact
42+
if: matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.10'
43+
uses: actions/upload-artifact@v3
44+
with:
45+
name: code-coverage-report
46+
path: htmlcov
47+
if-no-files-found: error
48+

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,13 @@ dmypy.json
127127

128128
# Pyre type checker
129129
.pyre/
130+
131+
_build/
132+
133+
# OS Specific
134+
.DS_Store
135+
136+
# IDE files
137+
.idea
138+
.idea/workspace.xml
139+

CITATION.cff

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
cff-version: 1.2.0
2+
message: "If you use this software, please cite it as below."
3+
authors:
4+
- family-names: "Kjeldsberg"
5+
given-names: "Henrik A."
6+
orcid: "0000-0002-7764-4248"
7+
title: "OasisMove"
8+
version: "0.1.0"
9+
date-released: 2023-01-28

CONDUCT.md

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
2+
# Code of Conduct
3+
4+
## Our Pledge
5+
6+
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
7+
8+
## Our Standards
9+
10+
Examples of behavior that contributes to creating a positive environment include:
11+
12+
* Using welcoming and inclusive language
13+
* Being respectful of differing viewpoints and experiences
14+
* Gracefully accepting constructive criticism
15+
* Focusing on what is best for the community
16+
* Showing empathy towards other community members
17+
18+
Examples of unacceptable behavior by participants include:
19+
20+
* The use of sexualized language or imagery and unwelcome sexual attention or advances
21+
* Trolling, insulting/derogatory comments, and personal or political attacks
22+
* Public or private harassment
23+
* Publishing others' private information, such as a physical or electronic address, without explicit permission
24+
* Other conduct which could reasonably be considered inappropriate in a professional setting
25+
26+
## Our Responsibilities
27+
28+
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
29+
30+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
31+
32+
## Scope
33+
34+
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
35+
36+
## Enforcement
37+
38+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
39+
40+
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
41+
42+
## Attribution
43+
44+
This Code of Conduct is adapted from the [Contributor Covenant, version 1.4](http://contributor-covenant.org/version/1/4).

CONTRIBUTING.md

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Contributing
2+
3+
Contributions are welcome, and they are greatly appreciated! Every little bit
4+
helps, and credit will always be given. You can contribute in the ways listed below.
5+
6+
## Report Bugs
7+
8+
Report bugs using GitHub issues.
9+
10+
If you are reporting a bug, please include:
11+
12+
* Your operating system name and version.
13+
* Any details about your local setup that might be helpful in troubleshooting.
14+
* Detailed steps to reproduce the bug.
15+
16+
## Fix Bugs
17+
18+
Look through the GitHub issues for bugs. Anything tagged with "bug" and "help
19+
wanted" is open to whoever wants to implement it.
20+
21+
## Implement Features
22+
23+
Look through the GitHub issues for features. Anything tagged with "enhancement"
24+
and "help wanted" is open to whoever wants to implement it.
25+
26+
## Write Documentation
27+
28+
OasisMove could always use more documentation, whether as part of the
29+
official OasisMove docs, in docstrings, or even on the web in blog posts,
30+
articles, and such.
31+
32+
## Submit Feedback
33+
34+
The best way to send feedback is to file an issue on GitHub.
35+
36+
If you are proposing a feature:
37+
38+
* Explain in detail how it would work.
39+
* Keep the scope as narrow as possible, to make it easier to implement.
40+
* Remember that this is a volunteer-driven project, and that contributions
41+
are welcome :)
42+
43+
## Get Started
44+
45+
Ready to contribute? Here's how to set up `OasisMove` for local development.
46+
47+
1. Fork the repo on GitHub.
48+
2. Clone your fork locally.
49+
3. Install your local copy into a virtualenv, e.g., using `conda`.
50+
4. Create a branch for local development and make changes locally.
51+
5. Commit your changes and push your branch to GitHub.
52+
6. Submit a pull request through the GitHub website.
53+
54+
## Code of Conduct
55+
56+
Please note that the OasisMove project is released with a [Contributor Code of Conduct](CONDUCT.md). By contributing to this project you agree to abide by its terms.

LICENSE

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GNU GENERAL PUBLIC LICENSE
22
Version 3, 29 June 2007
33

4-
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
4+
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
55
Everyone is permitted to copy and distribute verbatim copies
66
of this license document, but changing it is not allowed.
77

@@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
645645
GNU General Public License for more details.
646646

647647
You should have received a copy of the GNU General Public License
648-
along with this program. If not, see <https://www.gnu.org/licenses/>.
648+
along with this program. If not, see <http://www.gnu.org/licenses/>.
649649

650650
Also add information on how to contact you by electronic and paper mail.
651651

@@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
664664
You should also get your employer (if you work as a programmer) or school,
665665
if any, to sign a "copyright disclaimer" for the program, if necessary.
666666
For more information on this, and how to apply and follow the GNU GPL, see
667-
<https://www.gnu.org/licenses/>.
667+
<http://www.gnu.org/licenses/>.
668668

669669
The GNU General Public License does not permit incorporating your program
670670
into proprietary programs. If your program is a subroutine library, you
671671
may consider it more useful to permit linking proprietary applications with
672672
the library. If this is what you want to do, use the GNU Lesser General
673673
Public License instead of this License. But first, please read
674-
<https://www.gnu.org/licenses/why-not-lgpl.html>.
674+
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1-
# OasisMove
1+
# OasisMove
2+
_________________
3+
4+
[![GPL-3.0](https://img.shields.io/github/license/hkjeldsberg/oasismove)](LICENSE)
5+
[Read Latest Documentation](https://hkjeldsberg.github.io/oasismove/)
6+
_________________

0 commit comments

Comments
 (0)