Skip to content

Commit 3035231

Browse files
Merge pull request #122 from Skyscanner/update_actions
Various improvements
2 parents c31b96c + e11fc2e commit 3035231

8 files changed

+191
-18
lines changed

Diff for: .github/release-drafter.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name-template: 'v$RESOLVED_VERSION'
2+
tag-template: 'v$RESOLVED_VERSION'
3+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
4+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
5+
version-resolver:
6+
major:
7+
labels:
8+
- 'major'
9+
minor:
10+
labels:
11+
- 'minor'
12+
patch:
13+
labels:
14+
- 'patch'
15+
default: patch
16+
template: |
17+
## Changes

Diff for: .github/workflows/pypi-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ jobs:
2424
run: python setup.py sdist bdist_wheel
2525

2626
- name: Publish distribution 📦 to PyPI
27-
uses: pypa/gh-action-pypi-publish@master
27+
uses: pypa/gh-action-pypi-publish@release/v1
2828
with:
2929
password: ${{ secrets.pypi_password }}

Diff for: Makefile

+26-11
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ SOURCES = $(shell find . -name "*.py")
33
install:
44
pip install -r requirements.txt
55

6-
install-dev: install
7-
pip install -e ".[dev]"
6+
install-dev:
7+
pip install -r requirements.txt -r requirements-dev.txt .
88

99
install-docs:
10-
pip install -e ".[dev,docs]"
10+
pip install -r requirements.txt -r requirements-docs.txt .
1111

1212
format: isort-format black-format
1313

@@ -17,16 +17,16 @@ isort-format:
1717
black-format:
1818
black .
1919

20-
lint: isort-lint black-lint flake8-lint
20+
lint: isort-lint black-lint ruff-lint
2121

2222
isort-lint:
2323
isort --check-only .
2424

2525
black-lint:
2626
black --check .
2727

28-
flake8-lint:
29-
flake8 .
28+
ruff-lint:
29+
ruff check .
3030

3131
unit:
3232
pytest -svvv tests
@@ -42,10 +42,25 @@ test: lint unit
4242
test-docs:
4343
mkdocs build --strict
4444

45-
freeze:
46-
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile --no-emit-index-url --no-annotate --output-file requirements.txt setup.py
45+
FREEZE_OPTIONS = --no-emit-index-url --no-annotate -v --resolver=backtracking
46+
freeze-base:
47+
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile $(FREEZE_OPTIONS) setup.py --output-file requirements.txt
48+
freeze-dev:
49+
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile $(FREEZE_OPTIONS) setup.py --extra dev --output-file requirements-dev.txt
50+
freeze-docs:
51+
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile $(FREEZE_OPTIONS) setup.py --extra docs --output-file requirements-docs.txt
4752

48-
freeze-upgrade:
49-
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile --no-emit-index-url --upgrade --no-annotate --output-file requirements.txt setup.py
53+
freeze: freeze-base freeze-dev freeze-docs
5054

51-
.PHONY: install install-dev install-docs format isort-format black-format lint isort-lint black-lint flake8-lint unit coverage test freeze freeze-upgrade
55+
freeze-base-upgrade:
56+
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile $(FREEZE_OPTIONS) --upgrade setup.py --output-file requirements.txt
57+
freeze-dev-upgrade:
58+
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile $(FREEZE_OPTIONS) --upgrade setup.py --extra dev --output-file requirements-dev.txt
59+
freeze-docs-upgrade:
60+
CUSTOM_COMPILE_COMMAND="make freeze" pip-compile $(FREEZE_OPTIONS) --upgrade setup.py --extra docs --output-file requirements-docs.txt
61+
62+
freeze-upgrade: freeze-base-upgrade freeze-dev-upgrade freeze-docs-upgrade
63+
64+
.PHONY: install install-dev install-docs format isort-format black-format lint isort-lint black-lint flake8-lint unit \
65+
coverage test freeze freeze-upgrade freeze-base freeze-dev freeze-docs freeze-base-upgrade freeze-dev-upgrade \
66+
freeze-docs-upgrade

Diff for: pyproject.toml

+63
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,66 @@ include_trailing_comma = true
88
force_grid_wrap = 0
99
use_parentheses = true
1010
line_length = 120
11+
12+
[tool.ruff]
13+
# Exclude a variety of commonly ignored directories.
14+
exclude = [
15+
".bzr",
16+
".direnv",
17+
".eggs",
18+
".git",
19+
".git-rewrite",
20+
".hg",
21+
".ipynb_checkpoints",
22+
".mypy_cache",
23+
".nox",
24+
".pants.d",
25+
".pyenv",
26+
".pytest_cache",
27+
".pytype",
28+
".ruff_cache",
29+
".svn",
30+
".tox",
31+
".venv",
32+
".vscode",
33+
"__pypackages__",
34+
"_build",
35+
"buck-out",
36+
"build",
37+
"dist",
38+
"node_modules",
39+
"site-packages",
40+
"venv",
41+
]
42+
43+
# Same as Black.
44+
line-length = 120
45+
indent-width = 4
46+
47+
# Assume Python 3.7
48+
target-version = "py37"
49+
50+
[tool.ruff.lint]
51+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
52+
select = ["E4", "E7", "E9", "F"]
53+
ignore = []
54+
55+
# Allow fix for all enabled rules (when `--fix`) is provided.
56+
fixable = ["ALL"]
57+
unfixable = []
58+
59+
# Allow unused variables when underscore-prefixed.
60+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
61+
62+
[tool.ruff.format]
63+
# Like Black, use double quotes for strings.
64+
quote-style = "double"
65+
66+
# Like Black, indent with spaces, rather than tabs.
67+
indent-style = "space"
68+
69+
# Like Black, respect magic trailing commas.
70+
skip-magic-trailing-comma = false
71+
72+
# Like Black, automatically detect the appropriate line ending.
73+
line-ending = "auto"

Diff for: requirements-dev.txt

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.7
3+
# by the following command:
4+
#
5+
# make freeze
6+
#
7+
anyio==3.7.1
8+
black==23.3.0
9+
build==0.10.0
10+
certifi==2023.11.17
11+
click==8.1.7
12+
coverage[toml]==7.2.7
13+
exceptiongroup==1.2.0
14+
h11==0.14.0
15+
httpcore==0.17.3
16+
httpx==0.24.1
17+
idna==3.6
18+
importlib-metadata==4.2.0
19+
iniconfig==2.0.0
20+
isort==5.11.5
21+
mypy-extensions==1.0.0
22+
packaging==23.2
23+
pathspec==0.11.2
24+
pip-tools==6.14.0
25+
platformdirs==4.0.0
26+
pluggy==1.2.0
27+
pydantic==1.9.0
28+
pyproject-hooks==1.0.0
29+
pytest==7.4.3
30+
pytest-cov==4.1.0
31+
pytest-repeat==0.9.3
32+
ruff==0.1.9
33+
sniffio==1.3.0
34+
tomli==2.0.1
35+
typed-ast==1.5.5
36+
typing-extensions==4.7.1
37+
wheel==0.42.0
38+
zipp==3.15.0
39+
40+
# The following packages are considered to be unsafe in a requirements file:
41+
# pip
42+
# setuptools

Diff for: requirements-docs.txt

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.7
3+
# by the following command:
4+
#
5+
# make freeze
6+
#
7+
automacdoc==0.3
8+
beautifulsoup4==4.12.2
9+
click==8.1.7
10+
ghp-import==2.1.0
11+
importlib-metadata==6.7.0
12+
jinja2==3.1.2
13+
livereload==2.6.3
14+
markdown==3.4.4
15+
markupsafe==2.1.3
16+
mergedeep==1.3.4
17+
mkdocs==1.3.0
18+
mkdocs-material==4.6.3
19+
mkdocstrings==0.10.0
20+
packaging==23.2
21+
pydantic==1.9.0
22+
pygments==2.17.2
23+
pymdown-extensions==10.2.1
24+
python-dateutil==2.8.2
25+
pytkdocs==0.2.1
26+
pyyaml==6.0.1
27+
pyyaml-env-tag==0.1
28+
six==1.16.0
29+
soupsieve==2.4.1
30+
tornado==6.2
31+
typing-extensions==4.7.1
32+
watchdog==3.0.0
33+
zipp==3.15.0

Diff for: requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#
2-
# This file is autogenerated by pip-compile with python 3.9
3-
# To update, run:
2+
# This file is autogenerated by pip-compile with Python 3.7
3+
# by the following command:
44
#
55
# make freeze
66
#
77
pydantic==1.9.0
8-
typing-extensions==4.1.1
8+
typing-extensions==4.7.1

Diff for: setup.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99

1010
dev_requires = [
1111
"black>=22.1.0",
12-
"flake8>=3.8.3",
1312
"httpx>=0.14.2",
1413
"isort>=5.4.2",
1514
"pip-tools>=2.0.2",
1615
"pytest>=6.0.1",
1716
"pytest-cov>=2.10.1",
1817
"pytest-repeat==0.9.3",
18+
"ruff",
1919
]
2020

2121
docs_requires = [
@@ -28,7 +28,7 @@
2828

2929
setup(
3030
name="pycfmodel",
31-
version="0.21.1",
31+
version="0.21.2",
3232
description="A python model for CloudFormation scripts",
3333
author="Skyscanner Product Security",
3434
author_email="[email protected]",
@@ -39,5 +39,8 @@
3939
python_requires=">=3.7",
4040
install_requires=install_requires,
4141
tests_require=dev_requires,
42-
extras_require={"dev": dev_requires, "docs": docs_requires},
42+
extras_require={
43+
"dev": dev_requires,
44+
"docs": docs_requires,
45+
},
4346
)

0 commit comments

Comments
 (0)