-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Перенос http-toolkit в github #1
Changes from 31 commits
6b7e35f
b9e808f
7cb2844
52f3d17
82dc5cb
442c128
38519ff
6f5f056
13b0d79
2a6b7ab
dd4c8b7
39e9996
f5c90ab
a506a27
799a1bf
a5d696e
418866a
4d194a2
b3ebfc9
c303021
74d5e79
6b768f0
09bcb22
a6fe3ab
9126753
9a706ec
27f33ba
656a2a3
5b0a7c3
672061f
47b330a
a1f82ad
b20af2c
562c869
40f1384
a1d4145
3fe0f74
0a5fdd6
49e5d07
075dfb8
a8dd7ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.9' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: http-toolkit-build-and-push | ||
on: | ||
workflow_run: | ||
workflows: | ||
- http-toolkit-test | ||
types: | ||
- completed | ||
branches: | ||
- 'main' | ||
push: | ||
tags: | ||
- '*' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
env: | ||
BUILD_DEPENDENCIES: "build~=0.10.0" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: python-build | ||
uses: ./.github/actions/python-build | ||
- name: install-dependencies | ||
run: python3 -m pip install $BUILD_DEPENDENCIES $PUSH_DEPENDENCIES | ||
- name: build | ||
run: | | ||
ls . | ||
python -m build | ||
- name: store-dist | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
publish-to-pypi: | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/kontur_http_toolkit_core | ||
permissions: | ||
id-token: write | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
github-release: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. стоит ли оставлять такую job для создания релиза в github? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Напомню, что в github можно создавать теги с помощью команды или создания релиза в web-интерфейсе. И во время второго случая эта job будет падать с ошибкой |
||
name: >- | ||
Sign the Python 🐍 distribution 📦 with Sigstore | ||
and upload them to GitHub Release | ||
needs: | ||
- publish-to-pypi | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
id-token: write # IMPORTANT: mandatory for sigstore | ||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/gh-action-sigstore-python@v2.1.1 | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Create GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release create | ||
'${{ github.ref_name }}' | ||
--repo '${{ github.repository }}' | ||
--notes "" | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
run: >- | ||
gh release upload | ||
'${{ github.ref_name }}' dist/** | ||
--repo '${{ github.repository }}' | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: http-toolkit-test | ||
on: [push] | ||
env: | ||
TEST_DEPENDENCIES: "tox~=4.15.1" | ||
jobs: | ||
check-project-files: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: variables | ||
run: | | ||
PROJECT_FILES=(README.md pyproject.toml tox.ini) | ||
ERROR=0 | ||
- name: test | ||
run: | | ||
for file in ${PROJECT_FILES[*]}; do | ||
if ! [ -f $file ]; then | ||
echo "$file not found in project" | ||
ERROR=1 | ||
fi | ||
done | ||
exit $ERROR | ||
lint: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
linters: [pyproject, flake8, mypy] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: python-build | ||
uses: ./.github/actions/python-build | ||
- name: install-dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip install $TEST_DEPENDENCIES | ||
- name: test | ||
run: tox -e "${{ matrix.linters }}" | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
minor_versions: [8, 9, 10, 11, 12] | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.${{ matrix.minor_versions }}' | ||
- name: install-dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip install $TEST_DEPENDENCIES | ||
- name: test | ||
run: tox -e "py3${{ matrix.minor_versions }}" | ||
|
||
|
||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# Created by https://www.gitignore.io/api/python | ||
|
||
### Python ### | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
MANIFEST | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
.pytest_cache/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
db.sqlite3 | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
env.bak/ | ||
venv.bak/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
### Python Patch ### | ||
.venv/ | ||
|
||
### Python.VirtualEnv Stack ### | ||
# Virtualenv | ||
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ | ||
[Bb]in | ||
[Ii]nclude | ||
[Ll]ib | ||
[Ll]ib64 | ||
[Ll]ocal | ||
[Ss]cripts | ||
pyvenv.cfg | ||
pip-selfcheck.json | ||
|
||
|
||
### PyCharm ### | ||
.idea/ | ||
|
||
# tox envname junit/coverage reports | ||
/.reports |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Changelog | ||
|
||
### 1.0.0 | ||
|
||
**Date:** [24.07.24] | ||
|
||
* Библиотека для создания HTTP-клиентов к различным сервисам на основе HTTPX |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
нужно подумать над названием package. Предлагаю сделать просто http_toolkit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
и что, в следующий раз менять все зависимости?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
для контуровских репозиториев у нас же останется kontur_http_toolkit с специфичным кодом для Контура и который будет зависеть от http_toolkit с github, и вроде зависимости не придётся менять)