-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from octue/release/0.1.5
Release/0.1.5 Enabling task broker and improvements to CLI options
- Loading branch information
Showing
17 changed files
with
301 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
**I'm submitting a ...** | ||
- [ ] support request | ||
- [ ] bug report | ||
- [ ] feature request | ||
|
||
Please fill out the relevant sections below. | ||
|
||
--- | ||
|
||
## About Me | ||
|
||
If you're new to the twined ecosystem, and you don't mind, it'd be great to hear a little bit of the wider context about | ||
you and what you're working on, so we can understand how best to help. | ||
|
||
|
||
|
||
## Support request | ||
|
||
- [ ] I've searched the list of existing issues | ||
- [ ] I expected the docs to cover it in [this section](please provide link to where you'd expect to find help on this in the docs) but they don't cover it. | ||
|
||
I'm trying to [describe what you're trying to do]. | ||
|
||
|
||
|
||
## Feature request | ||
|
||
### Use Case | ||
|
||
Please [describe your motivation and use case]. | ||
|
||
### Current state | ||
|
||
Please describe what you're doing presently to work around this or achieve what you're doing. | ||
|
||
|
||
|
||
## Bug report | ||
|
||
### What is the current behavior? | ||
|
||
*If the current behavior is a bug, please provide any stack tracesthe steps to reproduce and if possible a minimal demo of the problem* | ||
|
||
### What is the expected behavior? | ||
|
||
### Your environment | ||
|
||
- Library Version: x.y.z | ||
- Platform MacOS | Windows | Linux | Other | ||
|
||
### Other information | ||
|
||
Please give as much detail as you can, like: | ||
|
||
- [ ] detailed explanation, | ||
- [ ] stacktraces | ||
- [ ] related issues | ||
- [ ] suggestions how to fix | ||
- [ ] links for us to have context, eg. stackoverflow, gitter, etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
<!-- PRs from release/x.y.z branches will be used to create Release Notes so make sure they contain everything --> | ||
<!-- Please don't add features not discussed in an issue first --> | ||
|
||
## Contents | ||
|
||
### New Features | ||
|
||
<!-- Write `Closes #xyz` to link issues that this PR completes, | ||
`WIP on #xyz` to link issues that this PR works toward. --> | ||
|
||
- [ ] Closes #xyz New thing for doing stuff | ||
- [ ] Closes #abc Another new thing for doing even more stuff | ||
|
||
### Breaking changes | ||
|
||
<!-- Breaking changes and how to work around them should be covered in the docs --> | ||
|
||
- [ ] Breaks a thing | ||
- [ ] Breaks another thing | ||
|
||
### Minor fixes and improvements | ||
|
||
- [ ] Closes #pqr An annoying bug | ||
- [ ] Closes #stu A tweak | ||
|
||
|
||
## Quality Checklist | ||
|
||
- [ ] New features are fully tested (No matter how much Coverage Karma you have) | ||
- [ ] **[v0.2 onward]** New features are included in the documentation | ||
- [ ] **[v0.2 onward]** Breaking changes are documented with clear instructions of what | ||
|
||
### Coverage Karma | ||
|
||
- [ ] If your PR decreases test coverage, do you feel you have built enough `Coverage Karma`* to justify it? | ||
|
||
*Coverage Karma can be earned by disproportionally increasing test coverage in the rest of your contributions. | ||
It's an honesty policy - you keep count of your own. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions. | ||
# | ||
# On successful test, the package will be published. For candidate releases, the package will be | ||
# published to test.pypi.org server (to ensure the process works). For merges to master, the | ||
# package will be published live. | ||
|
||
name: python-ci | ||
|
||
on: [push] | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
env: | ||
USING_COVERAGE: '3.8' | ||
strategy: | ||
matrix: | ||
python: [3.6, 3.7, 3.8] | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- name: Install Tox and any other packages | ||
run: pip install tox | ||
- name: Run Tox | ||
run: tox -e py | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: coverage.xml | ||
fail_ci_if_error: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
publish: | ||
if: contains(github.ref, 'main') || contains(github.ref, 'release/') | ||
runs-on: ubuntu-latest | ||
needs: tests | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Make package | ||
run: | | ||
python3 -m pip install --upgrade setuptools wheel | ||
python3 setup.py sdist bdist_wheel | ||
- name: Test package is publishable with PyPI test server | ||
if: contains(github.ref, 'release/') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.TEST_PYPI_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
- name: Publish latest package to PyPI | ||
if: contains(github.ref, 'main') | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
verbose: true | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
from .cli import octue_cli | ||
from .runner import LOG_FORMAT, Runner | ||
from .logging_handlers import LOG_FORMAT | ||
from .runner import Runner | ||
|
||
|
||
__all__ = "LOG_FORMAT", "octue_cli", "Runner" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import logging | ||
import logging.handlers | ||
from urllib.parse import urlparse | ||
|
||
|
||
# Logging format for analysis runs. All handlers should use this logging format, to make logs consistently parseable | ||
LOG_FORMAT = "%(name)s %(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s" | ||
|
||
|
||
def get_default_handler(log_level): | ||
""" Gets a basic console handler set up for logging analyses | ||
""" | ||
console_handler = logging.StreamHandler() | ||
console_handler.setLevel(log_level) | ||
formatter = logging.Formatter(LOG_FORMAT) | ||
console_handler.setFormatter(formatter) | ||
return console_handler | ||
|
||
|
||
def get_remote_handler(logger_uri, log_level): | ||
"""Get a log handler for streaming logs to a remote URI accessed via HTTP or HTTPS.""" | ||
parsed_uri = urlparse(logger_uri) | ||
|
||
if parsed_uri.scheme not in {"ws", "wss"}: | ||
raise ValueError( | ||
f"Only WS and WSS protocols currently supported for remote logger URI. Received {logger_uri!r}." | ||
) | ||
|
||
handler = logging.handlers.SocketHandler(host=parsed_uri.hostname, port=parsed_uri.port) | ||
handler.setLevel(log_level) | ||
handler.setFormatter(logging.Formatter(LOG_FORMAT)) | ||
return handler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.