Skip to content

Commit

Permalink
Merge pull request #53 from octue/release/0.0.14
Browse files Browse the repository at this point in the history
Release/0.0.14
  • Loading branch information
thclark committed Nov 20, 2020
2 parents 953dfe7 + 4266f02 commit 110708e
Show file tree
Hide file tree
Showing 41 changed files with 495 additions and 533 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ repos:
- '^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]+)*$'
- '^refactor/([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-]+)*))?$'
22 changes: 3 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,30 +44,14 @@ roadmap, into which you can make your PR. We'll help review the changes and impr

The process for creating a new release is as follows:

1. Check out a branch for the next version, called `vX.Y.Z`
1. Check out a branch for your release, called eg `release/X.Y.Z`
2. Create a Pull Request into the `main` branch.
3. Undertake your changes, committing and pushing to branch `vX.Y.Z`
3. Undertake your changes in other branches according to the git flow and create pull requests into `release/X.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 main. Successful test, doc build, flake8 and a new version number will automatically create the release on pypi.
10. Confirm the successful release on pypi
10. Go to code > releases and create a new release on GitHub at the same SHA.


### Building documents locally

**You don't need to do this unless you plan to develop Twined.**

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
```
4 changes: 2 additions & 2 deletions docs/source/quick_start_create_your_first_twine.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The loading process checks the twine itself is valid. It's as simple as:
from twined import Twine
my_twine = Twine(file='twine.json')
my_twine = Twine(source='twine.json')
.. _validate_some_inputs:
Expand All @@ -104,7 +104,7 @@ Then parse and validate directly from the file:

.. code-block:: py
my_input_values = my_twine.validate_input_values(file="input_values.json")
my_input_values = my_twine.validate_input_values(source="input_values.json")
.. ATTENTION::
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

setup(
name="twined",
version="0.0.13",
version="0.0.14",
py_modules=[],
install_requires=["jsonschema ~= 3.2.0", "python-dotenv"],
url="https://www.github.com/octue/twined",
Expand Down
57 changes: 56 additions & 1 deletion tests/base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,67 @@
import json
import os
import unittest


VALID_SCHEMA_TWINE = """
{
"configuration_values_schema": {
"$schema": "http://json-schema.org/2019-09/schema#",
"title": "The example configuration form",
"description": "The configuration strand of an example twine",
"type": "object",
"properties": {
"n_iterations": {
"description": "An example of an integer configuration variable, called 'n_iterations'.",
"type": "integer",
"minimum": 1,
"maximum": 10,
"default": 5
}
}
},
"input_values_schema": {
"$schema": "http://json-schema.org/2019-09/schema#",
"title": "Input Values",
"description": "The input values strand of an example twine, with a required height value",
"type": "object",
"properties": {
"height": {
"description": "An example of an integer value called 'height'",
"type": "integer",
"minimum": 2
}
},
"required": ["height"]
},
"output_values_schema": {
"title": "Output Values",
"description": "The output values strand of an example twine",
"type": "object",
"properties": {
"width": {
"description": "An example of an integer value called 'result'",
"type": "integer",
"minimum": 2
}
}
}
}
"""


class BaseTestCase(unittest.TestCase):
""" Base test case for twined:
- sets a path to the test data directory
"""

def setUp(self):
self.path = str(os.path.join(os.path.dirname(os.path.abspath(__file__)), "data", ""))
self.path = os.path.join(os.path.dirname(__file__), "data")
super().setUp()

def _write_json_string_to_file(self, json_string, directory_name):
"""Write a JSON string to a JSON file in the given directory."""
valid_schema_twine_file_path = os.path.join(directory_name, "json_written_to_file.json")
with open(valid_schema_twine_file_path, "w") as f:
json.dump(json.loads(json_string), f)
return valid_schema_twine_file_path
13 changes: 0 additions & 13 deletions tests/data/children/extra_key.json

This file was deleted.

8 changes: 0 additions & 8 deletions tests/data/children/extra_property.json

This file was deleted.

7 changes: 0 additions & 7 deletions tests/data/children/invalid_env_name.json

This file was deleted.

7 changes: 0 additions & 7 deletions tests/data/children/valid.json

This file was deleted.

38 changes: 0 additions & 38 deletions tests/data/manifests/configuration/configuration_valid.json

This file was deleted.

38 changes: 0 additions & 38 deletions tests/data/manifests/inputs/input_valid.json

This file was deleted.

38 changes: 0 additions & 38 deletions tests/data/manifests/outputs/output_valid.json

This file was deleted.

3 changes: 0 additions & 3 deletions tests/data/twines/incorrect_version_twine.json

This file was deleted.

3 changes: 0 additions & 3 deletions tests/data/twines/invalid_children_dict_not_array_twine.json

This file was deleted.

9 changes: 0 additions & 9 deletions tests/data/twines/invalid_children_no_key_twine.json

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions tests/data/twines/invalid_credentials_no_name_twine.json

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions tests/data/twines/invalid_json_twine.json

This file was deleted.

10 changes: 0 additions & 10 deletions tests/data/twines/valid_children_twine.json

This file was deleted.

17 changes: 0 additions & 17 deletions tests/data/twines/valid_credentials_twine.json

This file was deleted.

4 changes: 0 additions & 4 deletions tests/data/twines/valid_empty_children_twine.json

This file was deleted.

0 comments on commit 110708e

Please sign in to comment.