Skip to content

Commit

Permalink
Merge pull request #18 from octue/release/0.1.3
Browse files Browse the repository at this point in the history
Release/0.1.3
  • Loading branch information
thclark committed Oct 3, 2020
2 parents fc12559 + b553af7 commit 0c2c4ac
Show file tree
Hide file tree
Showing 66 changed files with 3,168 additions and 928 deletions.
9 changes: 9 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[paths]
source =
octue/

[run]
omit =
env/*
tests/*
*/tests/*
53 changes: 53 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
exclude: 'build|.git|.tox|dist|octue.egg-info'
default_stages: [commit]
fail_fast: true
default_language_version:
python: python3 # force all unspecified python hooks to run python3
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 19.10b0
hooks:
- id: black
args: ['--line-length', '120']

- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.1
hooks:
- id: flake8
additional_dependencies: [flake8-isort]

- repo: https://github.com/thclark/pre-commit-sphinx
rev: 0.0.1
hooks:
- id: build-docs
additional_dependencies:
- 'scipy~=1.5.2'
- 'jsonschema~=3.2.0'

- repo: https://github.com/windpioneers/pre-commit-hooks
rev: 0.0.5
hooks:
- id: check-branch-name
args:
- '^master$'
- '^development$'
- '^devops/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^doc/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^feature/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^fix/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^hotfix/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^review/([a-z][a-z0-9]*)(-[a-z0-9]+)*$'
- '^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-]+)*))?$'
29 changes: 29 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
dist: trusty
language: python
python:
- '3.6'

# Install tox and codecov
install:
- pip install tox-travis
- pip install codecov

# Use tox to run tests in the matrix of environments
script:
- tox -r

# Push the results back to codecov
after_success:
- coverage xml && codecov -f coverage.xml --commit=$TRAVIS_COMMIT

# Deploy updates on master to pypi, which will only succeed if there's been a version bump
deploy:
provider: pypi
skip_cleanup: true
skip_existing: true
edge: true
user: octue
password:
secure: "m8URYQxxMK+gRqkLvrYus9N/D2Nk69TBYGOivegAYd8gIDomwTUrejYkNHKmU0F6CyB1CqttBSREFabiF2Hjst/WHRyrGhI33vBiKINqc7mI6+wCay+HaCiMAouGp0W/D5FTrLuIcmBO1qeaHmky5zXNNLPGkKLJ+MjFCyfQXjlbvmhG+REo0X9EG4xgFnUKaaWfq4oqGTe6eZSRMbd9HSUgPuEedZHlxAindPaUvv8pZYGK7zZnLvSrFw9IcjdcPD/2U5aabPiwuPl8yRFMsu7j7ZxllvENTGIAZSoau9g8gOvJ7+q6DvcnlGtxyU5ghrLKHYCJP6g5BJMwMO1vuvjG0VGOTXpErvkab3fley5it+ETZTFPOUucRnHPvrVGU5/qxjW0381zSnzn/6yx8SEV//m3MJfumLJ8jGsPnTF4wW2ygS5oiptVYuwP5CFGCpY746Xx3SAjFIdV1JHKiUSy/wRtOFFEJuUyML2K0UlLi4rnejZpx1NRrvQ4pt7n+/G+cYXvSnqvkKztCkz1D5K5l/mI98VhVg21LreXbkEpknHupVmX9LCNOetlir0aYw3f8aP07OgYVa/+jlqla7xUGDSRA9WjBNSbmos8pVi22KNhdgk5VZccLwLGKz8wc+mqzBsmALr2L1u4AePWDMCl8SotjbSYs8O0V0YXjgU="
on:
branch: master
5 changes: 5 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include LICENSE
include README.md
include setup.py
include setup.cfg
recursive-include octue *
133 changes: 132 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,133 @@
[![PyPI version](https://badge.fury.io/py/octue.svg)](https://badge.fury.io/py/octue)
[![Build Status](https://travis-ci.com/octue/octue-sdk-python.svg?branch=master)](https://travis-ci.com/octue/octue-sdk-python)
[![codecov](https://codecov.io/gh/octue/octue-sdk-python/branch/master/graph/badge.svg?token=4KdR7fmwcT)](undefined)
[![Documentation Status](https://readthedocs.org/projects/octue/badge/?version=latest)](https://octue.readthedocs.io/en/latest/?badge=latest)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![black-girls-code](https://img.shields.io/badge/black%20girls-code-f64279.svg)](https://www.blackgirlscode.com/)

# octue-sdk-python <span><img src="http://slurmed.com/fanart/javier/213_purple-fruit-snake.gif" alt="Purple Fruit Snake" width="100"/></span>
SDK for python based apps running within octue.

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.

[See documentation.](https://octue.readthedocs.io/en/latest)


## Developer notes

**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.**

### Getting started

1. Click 'use this template' to the top right, and away you go.
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!
3. Set up the license you need in `LICENSE`.
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).

### Pre-Commit

You need to install pre-commit to get the hooks working. Do:
```
pip install pre-commit
pre-commit install
```

Once that's done, each time you make a commit, the following checks are made:

- valid github repo and files
- code style
- import order
- PEP8 compliance
- documentation build
- branch naming convention

Upon failure, the commit will halt. **Re-running the commit will automatically fix most issues** except:

- The flake8 checks... hopefully over time Black (which fixes most things automatically already) will negate need for it.
- You'll have to fix documentation yourself prior to a successful commit (there's no auto fix for that!!).

You can run pre-commit hooks without making a commit, too, like:
```
pre-commit run black --all-files
```
or
```
# -v gives verbose output, useful for figuring out why docs won't build
pre-commit run build-docs -v
```


### Contributing

- Please raise an issue on the board (or add your $0.02 to an existing issue) so the maintainers know
what's happening and can advise / steer you.

- 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,
you'll need to do something like:
```
git clone <your_forked_repo_address> # Fetches the repo to your local machine
cd octue-sdk-python # Move into the repo directory
pyenv virtualenv 3.6.9 myenv # Makes a virtual environment for you to install the dev tools into. Use any python >= 3.6
pyend activate myenv # Activates the virtual environment so you don't screw up other installations
pip install -r requirements-dev.txt # Installs the testing and code formatting utilities
pre-commit install # Installs the pre-commit code formatting hooks in the git repo
tox # Runs the tests with coverage. NB you can also just set up pycharm or vscode to run these.
```

- Adopt a Test Driven Development approach to implementing new features or fixing bugs.

- Ask the maintainers *where* to make your pull request. We'll create a version branch, according to the
roadmap, into which you can make your PR. We'll help review the changes and improve the PR.

- 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.

- Once all the roadmapped features for that version are done, we'll release.


### Release process

The process for creating a new release is as follows:

1. Check out a branch for the next version, called `vX.Y.Z`
2. Create a Pull Request into the `master` branch.
3. Undertake your changes, committing and pushing to branch `vX.Y.Z`
4. Ensure that documentation is updated to match changes, and increment the changelog. **Pull requests which do not update documentation will be refused.**
5. Ensure that test coverage is sufficient. **Pull requests that decrease test coverage will be refused.**
6. Ensure code meets style guidelines (pre-commit scripts and flake8 tests will fail otherwise)
7. Address Review Comments on the PR
8. Ensure the version in `setup.py` is correct and matches the branch version.
9. Merge to master. Successful test, doc build, flake8 and a new version number will automatically create the release on pypi.
10. Go to code > releases and create a new release on GitHub at the same SHA.


## Documents

### Building documents automatically

The documentation will build automatically in a pre-configured environment when you make a commit.

In fact, the way pre-commit works, you won't be allowed to make the commit unless the documentation builds,
this way we avoid getting broken documentation pushed to the main repository on any commit sha, so we can rely on
builds working.


### Building documents manually

**If you did need to build the documentation**

Install `doxgen`. On a mac, that's `brew install doxygen`; other systems may differ.

Install sphinx and other requirements for building the docs:
```
pip install -r docs/requirements.txt
```

Run the build process:
```
sphinx-build -b html docs/source docs/build
```

Tom Clark, founder of octue
We've been developing open-source tools to make
it easy for normal, mortal scientists and
engineers to easily create, use and connect
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
doctrees
html
7 changes: 7 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

# Required by the python script for building documentation
Sphinx==1.8.3
sphinx-rtd-theme==0.4.2
sphinx-tabs==1.1.10
breathe==4.11.1
exhale==0.2.1

0 comments on commit 0c2c4ac

Please sign in to comment.