Skip to content

Commit f8e7950

Browse files
tjholmHomelessDinosaurjyecuschdavemooreuws
authored
feat!: Python v1 (#127)
* update contracts * remove unused imports * update dependencies * new contracts and project structure * update security definition to Api attachment. * Implement key scanning. * update deployment workflows. --------- Co-authored-by: Ryan Cartwright <fryzee.cartwright@gmail.com> Co-authored-by: Jye Cusch <jye.cusch@nitric.io> Co-authored-by: David Moore <davemooreuws@gmail.com>
1 parent e82fc4a commit f8e7950

86 files changed

Lines changed: 5347 additions & 8129 deletions

Some content is hidden

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

.github/workflows/publish.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: Publish release to Pypi
22

33
on:
4-
release:
5-
types: [published]
6-
4+
push:
5+
# run only against tags
6+
tags:
7+
- '*'
8+
79
jobs:
810
publish:
911
runs-on: ubuntu-latest

.github/workflows/rc-release.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,18 @@ on:
44
branches:
55
- main
66
jobs:
7-
# Bump the SDK version
8-
version_bump:
9-
name: Bump Version and Create Release
10-
runs-on: ubuntu-latest
7+
release:
8+
name: semantic-release
9+
runs-on: ubuntu-20.04
1110
outputs:
12-
version_id: ${{ steps.tag_version.outputs.new_tag }}
13-
upload_url: ${{ steps.create_release.outputs.upload_url }}
11+
new-release-published: ${{ steps.semantic-release.outputs.new_release_published }}
12+
new-release-version: ${{ steps.semantic-release.outputs.new_release_version }}
1413
steps:
15-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1615
with:
1716
fetch-depth: 0
18-
- name: Bump version and push tag
19-
id: tag_version
20-
uses: mathieudutour/github-tag-action@v5.5
21-
with:
22-
# Use GITHUB_TOKEN here to prevent further workflows
23-
# generated on 'tag' action
24-
github_token: ${{ secrets.GITHUB_TOKEN }}
25-
- name: Create a GitHub release
26-
id: create_release
27-
uses: actions/create-release@v1
17+
persist-credentials: false
18+
- id: semantic-release
19+
uses: cycjimmy/semantic-release-action@v4
2820
env:
29-
# Use NITRIC_BOT_TOKEN here to
30-
# trigger release 'published' workflows
3121
GITHUB_TOKEN: ${{ secrets.NITRIC_BOT_TOKEN }}
32-
with:
33-
tag_name: ${{ steps.tag_version.outputs.new_tag }}
34-
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
35-
body: ${{ steps.tag_version.outputs.changelog }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
.idea/
22
.nitric/
33
nitric.yaml
4+
nitric.*.yaml
5+
proto/
46

57
# Byte-compiled / optimized / DLL files
68
__pycache__/

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,9 @@ The SDK is in early stage development and APIs and interfaces are still subject
4949
> nitric is included in all python related projects by default
5050
5151
```bash
52-
nitric new
52+
nitric new py-starter
5353
```
5454

55-
Follow the prompts and select `official/Python - Starter` as your template
56-
5755
### Adding to an existing project
5856

5957
**pip**
@@ -64,9 +62,11 @@ pip3 install nitric
6462
```
6563

6664
**pipenv**
65+
6766
```
6867
pipenv install nitric
6968
```
7069

7170
## Usage
72-
[Nitric Documentation](https://nitric.io/docs)
71+
72+
[Nitric Documentation](https://nitric.io/docs)

makefile

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,25 +21,32 @@ test:
2121
@echo Running Tox tests
2222
@tox -e py
2323

24-
NITRIC_VERSION="v0.32.0"
24+
NITRIC_VERSION := 1.1.0
25+
26+
download-local:
27+
@rm -r ./proto/nitric
28+
@mkdir ./proto/nitric
29+
@cp -r ${NITRIC_CORE_HOME}/nitric/proto ./proto/nitric
2530

2631
download:
27-
@curl -L https://github.com/nitrictech/nitric/releases/download/${NITRIC_VERSION}/contracts.tgz -o contracts.tgz
28-
@tar xvzf contracts.tgz
29-
@rm contracts.tgz
32+
@mkdir -p ./proto/
33+
@curl -L https://github.com/nitrictech/nitric/releases/download/v${NITRIC_VERSION}/proto.tgz -o ./proto/nitric.tgz
34+
@cd ./proto && tar xvzf nitric.tgz
35+
@cd ../
36+
@rm ./proto/nitric.tgz
37+
38+
OUTPUT="."
39+
CONTRACTS="./proto"
3040

31-
OUTPUT="./nitric/proto"
32-
CONTRACTS="./contracts"
41+
grpc-client: install download generate-proto
3342

34-
grpc-client: install download
43+
generate-proto:
3544
@echo Generating Proto Sources
45+
@ rm -rf $(OUTPUT)/nitric/proto
3646
@echo $(OUTPUT)
3747
@mkdir -p $(OUTPUT)
38-
# protoc doesn't create the __init__.py for the nitric module, so we need to create it.
39-
@mkdir -p $(OUTPUT)/nitric/
40-
@touch $(OUTPUT)/nitric/__init__.py
41-
@python3 -m grpc_tools.protoc -I $(CONTRACTS) --python_betterproto_out=$(OUTPUT) ./contracts/proto/*/*/*.proto
42-
48+
@python3 -m grpc_tools.protoc -I $(CONTRACTS) --python_betterproto_out=$(OUTPUT) ./$(CONTRACTS)/nitric/proto/*/*/*.proto
49+
@rm ./__init__.py
4350

4451
license:
4552
@echo Applying Apache 2 header to source files

nitric/api/__init__.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

nitric/api/const.py

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)