-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Create .gitignore * project bootstrap * Create release.yaml * Update release.yaml * Update release.yaml * Update release.yaml * triggers * Update release.yaml * Update release.yaml * Update release.yaml * Update release.yaml * Update release.yaml * Update release.yaml * Update release.yaml * Update release.yaml * Update release.yaml * Update release.yaml * adjust packaged files * update
- Loading branch information
Showing
7 changed files
with
116 additions
and
0 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,53 @@ | ||
name: release | ||
|
||
# Workflow Triggers | ||
on: | ||
# On a PullRequest against main | ||
pull_request: | ||
branches: [ "main" ] | ||
types: ["closed", "synchronize"] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
env: | ||
COUNCIL_DRAFT: ${{ github.event.pull_request.merged == false }} | ||
COUNCIL_LATEST: ${{ github.event.pull_request.merged == true }} | ||
|
||
jobs: | ||
release: | ||
# Pull Request object schema: https://docs.github.com/en/graphql/reference/objects#pullrequest | ||
if: | | ||
${{ contains(github.event.pull_request.labels.*.name, 'release') }} | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
- name: Installing dev requirements | ||
run: pip3 install -r dev-requirements.txt | ||
- name: Packaging | ||
run: hatch build | ||
- name: Version | ||
id: hatch-version | ||
run: | | ||
echo version=$(hatch version) >> $GITHUB_OUTPUT | ||
- name: Git Release | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
artifacts: "dist/*" | ||
draft: ${{ env.COUNCIL_DRAFT }} | ||
generateReleaseNotes: true | ||
makeLatest: ${{ env.COUNCIL_LATEST }} | ||
tag: v${{ steps.hatch-version.outputs.version }} | ||
updateOnlyUnreleased: true | ||
|
||
- name: env var | ||
run: export | ||
if: always() |
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,8 @@ | ||
## Jetbrains | ||
.idea | ||
|
||
## Macos | ||
.DS_Store | ||
|
||
## Python | ||
dist |
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,2 @@ | ||
def hello_word(name: str = "") -> str: | ||
return f"Hello {name or 'World'}!" |
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 @@ | ||
hatch==1.7.0 |
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,42 @@ | ||
[build-system] | ||
requires = ["hatchling", "hatch-requirements-txt"] | ||
build-backend = "hatchling.build" | ||
|
||
[project] | ||
name = "council-ai" | ||
version = "0.0.1" | ||
description = "to do" | ||
requires-python = ">=3.9" | ||
|
||
dynamic = ["dependencies"] | ||
|
||
[tool.hatch.build] | ||
exclude = [ | ||
".github", | ||
"*-requirements.txt", | ||
"tests", | ||
"venv", | ||
] | ||
|
||
package = ['council_ai'] | ||
|
||
[tool.hatch.metadata.hooks.requirements_txt] | ||
files = ["requirements.txt"] | ||
|
||
[tool.black] | ||
line-length = 120 | ||
|
||
[tool.pytest.ini_options] | ||
log_cli = true | ||
log_cli_level = "DEBUG" | ||
log_cli_format="[%(asctime)s %(levelname)s %(threadName)s %(name)s:%(funcName)s:%(lineno)s] %(message)s" | ||
log_cli_date_format="%Y-%m-%d %H:%M:%S%z" | ||
|
||
[tool.ruff] | ||
exclude = ["__init__.py", "docs"] | ||
line-length = 120 | ||
|
||
[tool.mypy] | ||
exclude = "(?x)(venv|docs)" | ||
mypy_path= "./stubs" | ||
explicit_package_bases = "true" |
Empty file.
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,10 @@ | ||
import unittest | ||
import council_ai | ||
|
||
|
||
class TestHello(unittest.TestCase): | ||
def test_hello(self): | ||
self.assertEqual("Hello World!", council_ai.hello_word()) | ||
|
||
def test_hello_council(self): | ||
self.assertEqual("Hello Council!", council_ai.hello_word("Council")) |