-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
124 additions
and
104 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 |
---|---|---|
@@ -1,37 +1,47 @@ | ||
# This workflow will upload a Python Package using Twine when a release is created | ||
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries | ||
|
||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
|
||
name: Upload Python Package | ||
name: Upload Python Package & Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
deploy: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install build | ||
python .github/workflows/update_version.py | ||
- name: Build package | ||
run: python -m build | ||
- name: Publish package | ||
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: 'pip' | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip | ||
pip install -U build setuptools wheel | ||
- name: Build package | ||
run: | | ||
python .github/workflows/update-version.py | ||
python -m build -n | ||
- name: Release assets | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/* | ||
#- name: pypi-publish | ||
# uses: pypa/gh-action-pypi-publish@release/v1 | ||
# with: | ||
# user: __token__ | ||
# password: ${{ secrets.PYPI_API_TOKEN }} |
This file was deleted.
Oops, something went wrong.
9 changes: 3 additions & 6 deletions
9
.github/workflows/started_notify.yml → .github/workflows/started-notify.yml
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,17 +1,14 @@ | ||
name: Star Notify | ||
name: Started Notify | ||
on: | ||
watch: | ||
types: [started] | ||
types: [ started ] | ||
jobs: | ||
Notify: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Dependencies | ||
run: | | ||
pip install yagmail[all] requests | ||
- name: Download Scripts | ||
run: | | ||
wget https://raw.githubusercontent.com/foyoux/started-notify/main/.github/workflows/started_notify.py#${{github.run_id}} | ||
- name: Send Email | ||
- name: Send Notify Email | ||
run: | | ||
python started_notify.py ${{github.token}} ${{secrets.NOTIFY_EMAIL}} |
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,22 @@ | ||
import os | ||
import re | ||
from pathlib import Path | ||
|
||
|
||
def main(): | ||
tag = os.getenv('GITHUB_REF_NAME') | ||
if not tag: | ||
raise RuntimeError('tag not exists') | ||
if not tag.startswith('v'): | ||
raise ValueError(f'tag({tag}) not starts with "v"') | ||
print(f'tag: {tag}') | ||
init = Path('src/pygtrans/__init__.py') | ||
init.write_text(re.sub( | ||
r'^__version__ = [\'"]\d+\.\d+\.\d+[\'"]$', | ||
f"__version__ = '{tag[1:]}'", | ||
init.read_text(encoding='utf8'), flags=re.M | ||
), encoding='utf8') | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
graft src/pygtrans/templates |
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,7 +1,48 @@ | ||
[build-system] | ||
requires = [ | ||
"setuptools>=42", | ||
"wheel" | ||
] | ||
requires = ["setuptools>=61.0"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
|
||
[project] | ||
name = "pygtrans" | ||
authors = [ | ||
{ name = "foyoux" }, | ||
] | ||
description = "python package pygtrans" | ||
keywords = ["pygtrans"] | ||
readme = "README.md" | ||
requires-python = ">=3.7" | ||
classifiers = [ | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
] | ||
dynamic = ["version", "dependencies"] | ||
|
||
|
||
[project.urls] | ||
"Source" = "https://github.com/foyoux/pygtrans" | ||
"Homepage" = "https://github.com/foyoux/pygtrans" | ||
"Bug Tracker" = "https://github.com/foyoux/pygtrans/issues" | ||
|
||
|
||
[project.scripts] | ||
pygtrans = "pygtrans:main" | ||
|
||
|
||
[tool.setuptools] | ||
include-package-data = true | ||
|
||
|
||
[tool.setuptools.dynamic] | ||
version = { attr = "pygtrans.__version__" } | ||
dependencies = { file = "requirements.txt" } | ||
|
||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
exclude = ["tests*"] |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,4 @@ | ||
from pygtrans import main | ||
|
||
if __name__ == '__main__': | ||
main() |
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,14 @@ | ||
import os.path | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
|
||
@pytest.fixture | ||
def data(): | ||
return {'pytest': 'fixture'} | ||
|
||
|
||
@pytest.fixture | ||
def base(): | ||
return Path(os.path.dirname(__file__)) |