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

TG-824 refactoring bootstrap collector #41

Merged
merged 5 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 4 additions & 8 deletions .github/workflows/publish-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,20 @@ jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
-
name: Docker meta
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: 20tab/talos-nextjs
-
name: Login to DockerHub
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Build and push
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,17 @@ permissions:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install -r requirements/test.txt
- name: Run Test
run: |
python3 -m unittest
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install -r requirements/test.txt
- name: Run Test
run: |
python3 -m unittest
143 changes: 125 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,107 @@ __pycache__/
*.py[cod]
*$py.class

# mypy
.mypy_cache/
.dmypy.json
dmypy.json
# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-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/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
Expand All @@ -22,43 +115,57 @@ ENV/
env.bak/
venv.bak/

# Terraform
.terraform.lock*
.terraform/
*.tfstate*
terraform.tfvars

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# END https://github.com/github/gitignore/blob/master/Python.gitignore
# pytype static type analyzer
.pytype/

# JetBrains
.idea/
# Cython debug symbols
cython_debug/

# Eclipse / Kate
*.swp
# END https://github.com/github/gitignore/blob/master/Python.gitignore

# SublimeText
*.sublime-project
*.sublime-workspace
# START local

# Terraform
.terraform.lock*
.terraform/
*.log
*.tfstate*
terraform.tfvars
# JetBrains
.idea/

# Vim
[._]*.un~

# VisualStudioCode
.devcontainer/
.vscode/

# macOS
.DS_Store

# requirements
*/requirements/*.txt

# Ruff
.ruff_cache

# END local
30 changes: 23 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,56 @@
default_language_version:
python: python3
python: python3.11
exclude: ^(\{\{cookiecutter\.project_dirname\}\}.*)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v4.4.0"
hooks:
- id: check-added-large-files
args: ["--maxkb=1024"]
- id: check-case-conflict
- id: check-docstring-first
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-xml
- id: check-yaml
args: ["--allow-multiple-documents"]
- id: debug-statements
- id: detect-private-key
- id: end-of-file-fixer
- id: file-contents-sorter
files: ^(requirements.in)$
files: ^(requirements/\w*.in)$
args: ["--ignore-case", "--unique"]
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: ["--remove"]
- id: forbid-new-submodules
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: "v3.3.1"
hooks:
- id: pyupgrade
args: [--py310-plus]
args: [--py311-plus]
- repo: https://github.com/psf/black
rev: "22.12.0"
hooks:
- id: black
- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.0.0-alpha.4"
hooks:
- id: prettier
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.218
rev: v0.0.225
hooks:
- id: ruff
args:
- --fix
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.991"
hooks:
- id: mypy
args: ["--no-site-packages"]
- repo: https://github.com/trailofbits/pip-audit
rev: v2.4.13
hooks:
- id: pip-audit
args: ["--require-hashes", "--requirement", "requirements/local.txt"]
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ outdated: ## Check outdated requirements and dependencies

.PHONY: pip
pip: pip_update ## Compile requirements
python3 -m piptools compile --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/common.txt requirements/common.in
python3 -m piptools compile --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/local.txt requirements/local.in
python3 -m piptools compile --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/test.txt requirements/test.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/common.txt requirements/common.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/local.txt requirements/local.in
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/test.txt requirements/test.in

.PHONY: pip_update
pip_update: ## Update requirements and dependencies
python3 -m pip install -q -U pip~=22.3.0 pip-tools~=6.12.0 setuptools~=65.6.0 wheel~=0.38.0
python3 -m pip install -q -U pip~=22.3.0 pip-tools~=6.12.0 setuptools~=66.0.0 wheel~=0.38.0

.PHONY: precommit
precommit: ## Fix code formatting, linting and sorting imports
Expand All @@ -45,9 +45,11 @@ endif
simpletest:
python3 -m unittest $(simpletestargs)

.PHONY: shellplus
shellplus: ## Launch shell_plus
python3 -m manage shell_plus
.PHONY: test # Run full test and coverage
test:
python3 -m coverage run -m unittest
python3 -m coverage html
python3 -m coverage report

.PHONY: update
update: pip precommit_update ## Run update
Expand Down
Loading