-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
20 changed files
with
818 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
version: 2.1 | ||
|
||
orbs: | ||
codecov: codecov/[email protected] | ||
|
||
jobs: | ||
build: | ||
docker: | ||
- image: cimg/python:3.10.0 | ||
environment: | ||
PIPENV_VENV_IN_PROJECT: true | ||
resource_class: medium | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- pipenv-{{ .Branch }}-{{ checksum "Pipfile.lock" }} | ||
- pipenv-{{ .Branch }}- | ||
- pipenv- | ||
- run: pipenv sync --dev | ||
- save_cache: | ||
key: pipenv-{{ .Branch }}-{{ checksum "Pipfile.lock" }} | ||
paths: | ||
- .venv | ||
- run: pipenv run ./lint.sh | ||
- run: pipenv run pytest | ||
- codecov/upload: | ||
file: coverage.xml | ||
- run: pipenv run ./build.sh | ||
- run: pip install dist/* | ||
- run: if [[ -z "${CIRCLE_TAG}" ]]; then circleci-agent step halt; fi | ||
- run: pipenv run twine upload dist/* | ||
|
||
workflows: | ||
default: | ||
jobs: | ||
- build: | ||
filters: | ||
branches: | ||
only: /.*/ | ||
tags: | ||
only: /.*/ |
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 @@ | ||
[flake8] | ||
exclude = .venv,dist | ||
ignore = E501, W503 | ||
max-line-length = 88 |
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,5 @@ | ||
.coverage | ||
changedifferently.egg-info | ||
coverage.xml | ||
dist | ||
htmlcov |
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,5 @@ | ||
{ | ||
"cSpell.words": [ | ||
"changedifferently" | ||
] | ||
} |
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,9 @@ | ||
extends: default | ||
|
||
ignore: | | ||
.venv | ||
rules: | ||
document-start: disable | ||
line-length: | ||
max: 88 |
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 @@ | ||
include changedifferently/version/VERSION |
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,20 @@ | ||
[[source]] | ||
url = "https://pypi.org/simple" | ||
verify_ssl = true | ||
name = "pypi" | ||
|
||
[packages] | ||
|
||
[dev-packages] | ||
black = "==21.9b0" | ||
flake8 = "*" | ||
isort = "*" | ||
mypy = "*" | ||
pytest = "*" | ||
pytest-cov = "*" | ||
twine = "*" | ||
shellcheck-py = "*" | ||
yamllint = "*" | ||
|
||
[requires] | ||
python_version = "3.10" |
Large diffs are not rendered by default.
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,16 @@ | ||
#!/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
if [[ -n ${1:-} ]]; then | ||
version=${1} | ||
elif [[ -n ${CIRCLE_TAG:-} ]]; then | ||
version=${CIRCLE_TAG} | ||
else | ||
version="-1.-1.-1" | ||
fi | ||
|
||
echo "${version}" > changedifferently/version/VERSION | ||
rm -rf dist | ||
python setup.py bdist_wheel | ||
rm -rf build |
Empty file.
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 @@ | ||
-1.-1.-1 |
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,7 @@ | ||
import importlib.resources as pkg_resources | ||
|
||
|
||
def get_version() -> str: | ||
"""Gets the package version.""" | ||
with pkg_resources.open_text(__package__, "VERSION") as t: | ||
return t.readline().strip() |
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,22 @@ | ||
#!/bin/env bash | ||
set -euo pipefail | ||
|
||
find . -name "*.sh" -not -path "*/.venv/*" -exec shellcheck -o all --severity style -x {} + | ||
|
||
yamllint --strict . | ||
|
||
if [ "${CI:=}" == "true" ]; then | ||
isort . --check-only --diff | ||
else | ||
isort . | ||
fi | ||
|
||
if [ "${CI:=}" == "true" ]; then | ||
black . --check --diff | ||
else | ||
black . | ||
fi | ||
|
||
flake8 . | ||
mypy changedifferently | ||
mypy tests |
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,3 @@ | ||
[mypy] | ||
pretty = True | ||
strict = True |
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,11 @@ | ||
[tool.black] | ||
exclude = '.venv' | ||
|
||
[tool.isort] | ||
profile = 'black' | ||
skip = '.venv' | ||
|
||
[tool.pytest.ini_options] | ||
addopts = '--cov=changedifferently --cov-branch --cov-report=html --cov-report=term-missing:skip-covered --cov-report=xml --no-cov-on-fail' | ||
log_cli = 1 | ||
testpaths = 'tests' |
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,56 @@ | ||
from pathlib import Path | ||
|
||
from setuptools import setup # pyright: reportMissingTypeStubs=false | ||
|
||
from changedifferently.version import get_version | ||
|
||
readme_path = Path(__file__).parent / "README.md" | ||
|
||
with open(readme_path, encoding="utf-8") as f: | ||
long_description = f.read() | ||
|
||
classifiers = [ | ||
"Environment :: Console", | ||
"License :: OSI Approved :: MIT License", | ||
"Natural Language :: English", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Topic :: Utilities", | ||
"Typing :: Typed", | ||
] | ||
|
||
version = get_version() | ||
|
||
if "a" in version: | ||
classifiers.append("Development Status :: 3 - Alpha") | ||
elif "b" in version: | ||
classifiers.append("Development Status :: 4 - Beta") | ||
else: | ||
classifiers.append("Development Status :: 5 - Production/Stable") | ||
|
||
classifiers.sort() | ||
|
||
setup( | ||
author="Cariad Eccleston", | ||
author_email="[email protected]", | ||
classifiers=classifiers, | ||
description="Visualises the changes described by an Amazon Web Services CloudFormation change set", | ||
include_package_data=True, | ||
license="MIT", | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
name="changedifferently", | ||
packages=[ | ||
"changedifferently", | ||
"changedifferently.version", | ||
], | ||
package_data={ | ||
"changedifferently": ["py.typed"], | ||
"changedifferently.version": ["py.typed"], | ||
}, | ||
python_requires=">=3.8", | ||
url="https://github.com/cariad/changedifferently", | ||
version=version, | ||
) |
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,5 @@ | ||
from changedifferently.version import get_version | ||
|
||
|
||
def test_get_version() -> None: | ||
assert get_version() == "-1.-1.-1" |