Skip to content
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

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
6b7e35f
PI-544 initial commit
Apr 10, 2024
b9e808f
PI-544 Отделить код специфичный для Контура
Aug 14, 2024
7cb2844
Merge branch 'PI-544-seperate-kontur-code' into 'master'
Aug 14, 2024
52f3d17
PI-544 initial commit
Apr 10, 2024
82dc5cb
rebase master
Aug 14, 2024
442c128
initial_commit
Sep 19, 2024
38519ff
fix checkout
Sep 19, 2024
6f5f056
fix checkout
Sep 19, 2024
13b0d79
fix .action
Sep 19, 2024
2a6b7ab
remove env PIP_INDEX_URL
Sep 19, 2024
dd4c8b7
fix flake8
Sep 19, 2024
39e9996
fix test
Sep 19, 2024
f5c90ab
fix test
Sep 19, 2024
a506a27
fix checkout
Sep 19, 2024
799a1bf
setup-python
Sep 19, 2024
a5d696e
check ls
Sep 19, 2024
418866a
checkout
Sep 19, 2024
4d194a2
package_name
Sep 19, 2024
b3ebfc9
add version from github
Sep 19, 2024
c303021
remove extra information and fix actions
Sep 19, 2024
74d5e79
fix version
Sep 19, 2024
6b768f0
fix version
Sep 19, 2024
09bcb22
fix readme
Sep 19, 2024
a6fe3ab
PI-544 initial commit
Apr 10, 2024
9126753
rebase master
Aug 14, 2024
9a706ec
remove gitlab-ci
Sep 19, 2024
27f33ba
PI-544 initial commit
Apr 10, 2024
656a2a3
initial commit
Aug 14, 2024
5b0a7c3
PI-544 initial commit
Apr 10, 2024
672061f
PI-544 initial commit
Apr 10, 2024
47b330a
delete extra files
Sep 19, 2024
a1f82ad
add dependency on branches
Sep 19, 2024
b20af2c
fix _version
Sep 19, 2024
562c869
add check_project_files
Sep 19, 2024
40f1384
удалить упоминания инфры контура
Sep 20, 2024
a1d4145
добавить автора
Sep 20, 2024
3fe0f74
Merge branch 'master' into 'github_actions'
Sep 20, 2024
0a5fdd6
fix import_error
Sep 20, 2024
49e5d07
fix import_error
Sep 20, 2024
075dfb8
Merge remote-tracking branch 'origin/github_actions' into github_actions
Sep 20, 2024
a8dd7ca
fix openetelemetry tests
Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/actions/python-build/action.yml
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'
88 changes: 88 additions & 0 deletions .github/workflows/build-and-push.yml
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
Copy link
Author

@kretatusha kretatusha Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

нужно подумать над названием package. Предлагаю сделать просто http_toolkit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и что, в следующий раз менять все зависимости?

Copy link
Author

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, и вроде зависимости не придётся менять)

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:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

стоит ли оставлять такую job для создания релиза в github?

Copy link
Author

Choose a reason for hiding this comment

The 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 }}'


57 changes: 57 additions & 0 deletions .github/workflows/test.yml
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 }}"





129 changes: 129 additions & 0 deletions .gitignore
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
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Changelog

### 1.0.0

**Date:** [24.07.24]

* Библиотека для создания HTTP-клиентов к различным сервисам на основе HTTPX
Loading