Skip to content

Commit

Permalink
Merge pull request #4 from workfloworchestrator/prepare-release
Browse files Browse the repository at this point in the history
Update from prepare-release
  • Loading branch information
acidjunk authored Feb 18, 2023
2 parents 6ab100d + 2646303 commit f7ffcc7
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 13 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/publish-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flit
- name: Build and publish
env:
FLIT_USERNAME: ${{ secrets.FLIT_USERNAME }}
FLIT_PASSWORD: ${{ secrets.FLIT_PASSWORD }}
run: |
flit publish
6 changes: 3 additions & 3 deletions .github/workflows/run-linting-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ jobs:
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 .
- name: Check with mypy
run: |
mypy .
# - name: Check with mypy
# run: |
# mypy .
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,18 @@ Forms can also consist out of wizard; so you can create complex form flows consi
consecutive forms. The forms and the validation logic are defined by
using [Pydantic](https://pydantic-docs.helpmanual.io/) models.

Documentation regarding the usage of Forms can be found
[here](https://github.com/workfloworchestrator/orchestrator-core/blob/main/docs/architecture/application/forms.md)

### Todo

This package is not ready for use in other projects. To make it production ready:

- [ ] Add tests for the Flask and FastAPI Exception handlers
- [ ] Add Flask example; a reference implementation is available in
the [pricelist-backend](https://github.com/acidjunk/pricelist-backend/blob/master/server/main.py)
- [ ] Setup docs boilerplate
- [ ] Copy orchestrator core form docs
- [ ] Publish package
- [x] Publish package

### Installation (Development standalone)
Install the project and its dependencies to develop on the code.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ description-file = "README.md"
requires-python = ">=3.7,<3.11"

[tool.flit.metadata.urls]
Documentation = "https://workfloworchestrator.org/orchestrator-core/"
Documentation = "https://github.com/workfloworchestrator/pydantic-forms/blob/main/README.md"

[tool.flit.metadata.requires-extra]
test = [
Expand Down
14 changes: 7 additions & 7 deletions tests/unit_tests/test_generic_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,23 +639,23 @@ class Form(FormPage):
}


@pytest.mark.xfail(reason="fix flakey test")
def test_read_only_field_schema():
class Form(FormPage):
read_only: int = ReadOnlyField(1, const=False)

assert Form.schema() == {
"additionalProperties": False,
"title": "unknown",
"type": "object",
"properties": {
"read_only": {
"const": 1,
"default": 1,
"title": "Read Only",
"type": "integer",
"const": 1,
"uniforms": {"disabled": True, "value": 1},
},
"type": "integer",
}
},
"title": "unknown",
"type": "object",
"additionalProperties": False,
}


Expand Down

0 comments on commit f7ffcc7

Please sign in to comment.