Skip to content

Commit 0c2c4ac

Browse files
authored
Merge pull request #18 from octue/release/0.1.3
Release/0.1.3
2 parents fc12559 + b553af7 commit 0c2c4ac

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+3168
-928
lines changed

.coveragerc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[paths]
2+
source =
3+
octue/
4+
5+
[run]
6+
omit =
7+
env/*
8+
tests/*
9+
*/tests/*

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
exclude: 'build|.git|.tox|dist|octue.egg-info'
2+
default_stages: [commit]
3+
fail_fast: true
4+
default_language_version:
5+
python: python3 # force all unspecified python hooks to run python3
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v3.1.0
9+
hooks:
10+
- id: trailing-whitespace
11+
- id: end-of-file-fixer
12+
- id: check-yaml
13+
- id: check-added-large-files
14+
15+
- repo: https://github.com/pre-commit/mirrors-isort
16+
rev: v4.3.21
17+
hooks:
18+
- id: isort
19+
20+
- repo: https://github.com/psf/black
21+
rev: 19.10b0
22+
hooks:
23+
- id: black
24+
args: ['--line-length', '120']
25+
26+
- repo: https://gitlab.com/pycqa/flake8
27+
rev: 3.8.1
28+
hooks:
29+
- id: flake8
30+
additional_dependencies: [flake8-isort]
31+
32+
- repo: https://github.com/thclark/pre-commit-sphinx
33+
rev: 0.0.1
34+
hooks:
35+
- id: build-docs
36+
additional_dependencies:
37+
- 'scipy~=1.5.2'
38+
- 'jsonschema~=3.2.0'
39+
40+
- repo: https://github.com/windpioneers/pre-commit-hooks
41+
rev: 0.0.5
42+
hooks:
43+
- id: check-branch-name
44+
args:
45+
- '^master$'
46+
- '^development$'
47+
- '^devops/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
48+
- '^doc/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
49+
- '^feature/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
50+
- '^fix/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
51+
- '^hotfix/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
52+
- '^review/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
53+
- '^release/(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P<buildmetadata>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$'

.travis.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
dist: trusty
2+
language: python
3+
python:
4+
- '3.6'
5+
6+
# Install tox and codecov
7+
install:
8+
- pip install tox-travis
9+
- pip install codecov
10+
11+
# Use tox to run tests in the matrix of environments
12+
script:
13+
- tox -r
14+
15+
# Push the results back to codecov
16+
after_success:
17+
- coverage xml && codecov -f coverage.xml --commit=$TRAVIS_COMMIT
18+
19+
# Deploy updates on master to pypi, which will only succeed if there's been a version bump
20+
deploy:
21+
provider: pypi
22+
skip_cleanup: true
23+
skip_existing: true
24+
edge: true
25+
user: octue
26+
password:
27+
secure: "m8URYQxxMK+gRqkLvrYus9N/D2Nk69TBYGOivegAYd8gIDomwTUrejYkNHKmU0F6CyB1CqttBSREFabiF2Hjst/WHRyrGhI33vBiKINqc7mI6+wCay+HaCiMAouGp0W/D5FTrLuIcmBO1qeaHmky5zXNNLPGkKLJ+MjFCyfQXjlbvmhG+REo0X9EG4xgFnUKaaWfq4oqGTe6eZSRMbd9HSUgPuEedZHlxAindPaUvv8pZYGK7zZnLvSrFw9IcjdcPD/2U5aabPiwuPl8yRFMsu7j7ZxllvENTGIAZSoau9g8gOvJ7+q6DvcnlGtxyU5ghrLKHYCJP6g5BJMwMO1vuvjG0VGOTXpErvkab3fley5it+ETZTFPOUucRnHPvrVGU5/qxjW0381zSnzn/6yx8SEV//m3MJfumLJ8jGsPnTF4wW2ygS5oiptVYuwP5CFGCpY746Xx3SAjFIdV1JHKiUSy/wRtOFFEJuUyML2K0UlLi4rnejZpx1NRrvQ4pt7n+/G+cYXvSnqvkKztCkz1D5K5l/mI98VhVg21LreXbkEpknHupVmX9LCNOetlir0aYw3f8aP07OgYVa/+jlqla7xUGDSRA9WjBNSbmos8pVi22KNhdgk5VZccLwLGKz8wc+mqzBsmALr2L1u4AePWDMCl8SotjbSYs8O0V0YXjgU="
28+
on:
29+
branch: master

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include LICENSE
2+
include README.md
3+
include setup.py
4+
include setup.cfg
5+
recursive-include octue *

README.md

Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,133 @@
1+
[![PyPI version](https://badge.fury.io/py/octue.svg)](https://badge.fury.io/py/octue)
2+
[![Build Status](https://travis-ci.com/octue/octue-sdk-python.svg?branch=master)](https://travis-ci.com/octue/octue-sdk-python)
3+
[![codecov](https://codecov.io/gh/octue/octue-sdk-python/branch/master/graph/badge.svg?token=4KdR7fmwcT)](undefined)
4+
[![Documentation Status](https://readthedocs.org/projects/octue/badge/?version=latest)](https://octue.readthedocs.io/en/latest/?badge=latest)
5+
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
6+
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
7+
[![black-girls-code](https://img.shields.io/badge/black%20girls-code-f64279.svg)](https://www.blackgirlscode.com/)
8+
19
# octue-sdk-python <span><img src="http://slurmed.com/fanart/javier/213_purple-fruit-snake.gif" alt="Purple Fruit Snake" width="100"/></span>
2-
SDK for python based apps running within octue.
10+
11+
Utilities for running python based data services, digital twins and applications with the Octue toolkit and [twined](https://www.twined.readthedocs.io) SDK for python based apps running within octue.
12+
13+
[See documentation.](https://octue.readthedocs.io/en/latest)
14+
15+
16+
## Developer notes
17+
18+
**Documentation for use of the library is [here](https://{{library_name}}.readthedocs.io). You don't need to pay attention to the following unless you plan to develop {{library_name}} itself.**
19+
20+
### Getting started
21+
22+
1. Click 'use this template' to the top right, and away you go.
23+
2. Search for `{{` in your new repository. Do search and replace for the various terms - it's obvious what they are, like replace `{{github_username}}` with your github username!
24+
3. Set up the license you need in `LICENSE`.
25+
4. If you need to deploy to pypi, you have to do the first deploy manually - travis can't do that for you. [See the packaging instructions](https://packaging.python.org/tutorials/distributing-packages/#uploading-your-project-to-pypi).
26+
27+
### Pre-Commit
28+
29+
You need to install pre-commit to get the hooks working. Do:
30+
```
31+
pip install pre-commit
32+
pre-commit install
33+
```
34+
35+
Once that's done, each time you make a commit, the following checks are made:
36+
37+
- valid github repo and files
38+
- code style
39+
- import order
40+
- PEP8 compliance
41+
- documentation build
42+
- branch naming convention
43+
44+
Upon failure, the commit will halt. **Re-running the commit will automatically fix most issues** except:
45+
46+
- The flake8 checks... hopefully over time Black (which fixes most things automatically already) will negate need for it.
47+
- You'll have to fix documentation yourself prior to a successful commit (there's no auto fix for that!!).
48+
49+
You can run pre-commit hooks without making a commit, too, like:
50+
```
51+
pre-commit run black --all-files
52+
```
53+
or
54+
```
55+
# -v gives verbose output, useful for figuring out why docs won't build
56+
pre-commit run build-docs -v
57+
```
58+
59+
60+
### Contributing
61+
62+
- Please raise an issue on the board (or add your $0.02 to an existing issue) so the maintainers know
63+
what's happening and can advise / steer you.
64+
65+
- Create a fork of octue-sdk-python, undertake your changes on a new branch, (see `.pre-commit-config.yaml` for branch naming conventions). To run tests and make commits,
66+
you'll need to do something like:
67+
```
68+
git clone <your_forked_repo_address> # Fetches the repo to your local machine
69+
cd octue-sdk-python # Move into the repo directory
70+
pyenv virtualenv 3.6.9 myenv # Makes a virtual environment for you to install the dev tools into. Use any python >= 3.6
71+
pyend activate myenv # Activates the virtual environment so you don't screw up other installations
72+
pip install -r requirements-dev.txt # Installs the testing and code formatting utilities
73+
pre-commit install # Installs the pre-commit code formatting hooks in the git repo
74+
tox # Runs the tests with coverage. NB you can also just set up pycharm or vscode to run these.
75+
```
76+
77+
- Adopt a Test Driven Development approach to implementing new features or fixing bugs.
78+
79+
- Ask the maintainers *where* to make your pull request. We'll create a version branch, according to the
80+
roadmap, into which you can make your PR. We'll help review the changes and improve the PR.
81+
82+
- Once checks have passed, test coverage of the new code is 100%, documentation is updated and the Review is passed, we'll merge into the version branch.
83+
84+
- Once all the roadmapped features for that version are done, we'll release.
85+
86+
87+
### Release process
88+
89+
The process for creating a new release is as follows:
90+
91+
1. Check out a branch for the next version, called `vX.Y.Z`
92+
2. Create a Pull Request into the `master` branch.
93+
3. Undertake your changes, committing and pushing to branch `vX.Y.Z`
94+
4. Ensure that documentation is updated to match changes, and increment the changelog. **Pull requests which do not update documentation will be refused.**
95+
5. Ensure that test coverage is sufficient. **Pull requests that decrease test coverage will be refused.**
96+
6. Ensure code meets style guidelines (pre-commit scripts and flake8 tests will fail otherwise)
97+
7. Address Review Comments on the PR
98+
8. Ensure the version in `setup.py` is correct and matches the branch version.
99+
9. Merge to master. Successful test, doc build, flake8 and a new version number will automatically create the release on pypi.
100+
10. Go to code > releases and create a new release on GitHub at the same SHA.
101+
102+
103+
## Documents
104+
105+
### Building documents automatically
106+
107+
The documentation will build automatically in a pre-configured environment when you make a commit.
108+
109+
In fact, the way pre-commit works, you won't be allowed to make the commit unless the documentation builds,
110+
this way we avoid getting broken documentation pushed to the main repository on any commit sha, so we can rely on
111+
builds working.
112+
113+
114+
### Building documents manually
115+
116+
**If you did need to build the documentation**
117+
118+
Install `doxgen`. On a mac, that's `brew install doxygen`; other systems may differ.
119+
120+
Install sphinx and other requirements for building the docs:
121+
```
122+
pip install -r docs/requirements.txt
123+
```
124+
125+
Run the build process:
126+
```
127+
sphinx-build -b html docs/source docs/build
128+
```
129+
130+
Tom Clark, founder of octue
131+
We've been developing open-source tools to make
132+
it easy for normal, mortal scientists and
133+
engineers to easily create, use and connect

docs/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
doctrees
2+
html

docs/requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
# Required by the python script for building documentation
3+
Sphinx==1.8.3
4+
sphinx-rtd-theme==0.4.2
5+
sphinx-tabs==1.1.10
6+
breathe==4.11.1
7+
exhale==0.2.1

0 commit comments

Comments
 (0)