-
Notifications
You must be signed in to change notification settings - Fork 2
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
All things tooling #26
Merged
Merged
Changes from 14 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
1b0286f
Fix strange punctuation choices
ewjoachim 462274d
Copy .gitignore from other project
ewjoachim 2babe2f
Add requirements.txt
ewjoachim 467ceb7
Exclude tests from packaging
ewjoachim a7daad0
There's no such thing as a universal wheel for a py3-only project
ewjoachim 821e8af
Add flake8 and mypy as linting tools
ewjoachim a93c5a5
Standardize tox.ini for tooling purposes
ewjoachim 1317788
Relicense to MIT
ewjoachim ce8adfe
Support Python 3.6 to 3.8
ewjoachim 37487ff
Apply suggestions from mypy
ewjoachim 903ee41
Apply isort
ewjoachim 319bb92
Add check-manifest to the mix
ewjoachim 4e180cc
Adjust codeowners
ewjoachim 5d07fbf
Add release script
ewjoachim fddeb12
Switch to docker compose
ewjoachim d885b3a
Add code of conduct
ewjoachim 0f001e0
Contributing doc (copies from peopledoc/procrastinate)
ewjoachim 65dacf8
Add pre-commit hook
ewjoachim f5a33fb
Pytest launches tests in order
ewjoachim 308c6f2
Copy doc system from procrastinate
ewjoachim d7a3c86
Rewrite README
ewjoachim 8d8fac6
Add missing title
ewjoachim 5046ef8
PR template
ewjoachim f75a286
Add Django to the wordlist
ewjoachim be3cb7f
Linting
ewjoachim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,2 @@ | ||
# Main maintainers | ||
* @mgu @ewjoachim |
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 |
---|---|---|
@@ -1,8 +1,12 @@ | ||
*.egg-info | ||
.pytest_cache | ||
__pycache__ | ||
.tox | ||
htmlcov | ||
.coverage | ||
dist/ | ||
build/ | ||
/.coverage | ||
.DS_Store | ||
/.mypy_cache | ||
/.pytest_cache | ||
/.tox | ||
*.egg-info | ||
/docs/_build | ||
/htmlcov | ||
/dist | ||
/build | ||
/.venv |
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
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2019, PeopleDoc | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this | ||
software and associated documentation files (the "Software"), to deal in the Software | ||
without restriction, including without limitation the rights to use, copy, modify, | ||
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or | ||
substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR | ||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT | ||
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
|
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,10 @@ | ||
prune tests | ||
prune docs | ||
prune example_migrations | ||
prune *.egg-info | ||
exclude .codecov.yml | ||
exclude requirements.txt | ||
exclude CONTRIBUTING.rst | ||
exclude CODE_OF_CONDUCT.md | ||
exclude tox.ini | ||
include LICENSE.rst |
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
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
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,64 @@ | ||
#!/bin/bash -eu | ||
|
||
BASE_BRANCH="master" | ||
REPO_OWNER="peopledoc" | ||
REPO="septentrion" | ||
|
||
# Check that you're on a clean checkout | ||
if ! git diff-index --quiet HEAD -- ; | ||
then | ||
echo "Repository not clean" | ||
git status | ||
exit 1 | ||
fi | ||
|
||
function increment_version() { | ||
python3 - "$1" <<EOF | ||
import sys | ||
version = sys.argv[1] | ||
rest, last = version.rsplit('.', 1) | ||
print(rest + '.' + str(int(last) + 1)) | ||
EOF | ||
} | ||
|
||
CHANGELOG="$(changelog $REPO_OWNER $REPO)" | ||
echo "Here are all the PRs merged since the last tag:" | ||
echo $CHANGELOG | ||
echo | ||
|
||
LATEST_VERSION=$(git describe --abbrev=0) | ||
echo "Latest version was $LATEST_VERSION" | ||
|
||
LATEST_INCREMENTED=$(increment_version $LATEST_VERSION) | ||
read -p "Version to release ($LATEST_INCREMENTED): " VERSION | ||
VERSION=${VERSION:-$LATEST_INCREMENTED} | ||
|
||
echo "Releasing $VERSION:" | ||
|
||
echo "- Writing version number to setup.cfg" | ||
sed -i "s/# version placeholder.\\+$/version = ${VERSION}/" setup.cfg | ||
|
||
# Python release | ||
echo "- Removing previous build artifacts" | ||
rm -rf dist/ build/ | ||
echo "- Creating the release" | ||
python3 setup.py sdist bdist_wheel | ||
echo "- Uploading to PyPI" | ||
twine upload dist/* | ||
|
||
echo "- Resetting setup.cfg" | ||
git checkout -- setup.cfg | ||
|
||
# Tag | ||
echo "- Creating (signed) tag ${VERSION}" | ||
git tag -s -m "Tag ${VERSION}" ${VERSION} | ||
echo "- Pushing tag" | ||
git push origin ${VERSION} | ||
|
||
echo "Released ${VERSION}" | ||
echo | ||
|
||
URL="https://github.com/peopledoc/septentrion/releases/new?title=Release $VERSION&body=$CHANGELOG&tag=$VERSION" | ||
echo "Please create the release in github:" | ||
echo " $URL" | ||
python -m webbrowser $URL |
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 @@ | ||
-e .[dev,test,lint] |
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
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
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 |
---|---|---|
@@ -1,23 +1,22 @@ | ||
[metadata] | ||
name = septentrion | ||
description = Execute PostGreSQL migrations | ||
version = 0.1.4.dev0 | ||
# version placeholder | ||
author = peopledoc | ||
author_email = [email protected] | ||
url = https://github.com/peopledoc/septentrion | ||
long_description = file: README.md | ||
long_description_content_type = text/markdown | ||
keywords = migrations postgresql | ||
license = Apache Software License | ||
license = MIT License | ||
classifiers = | ||
Development Status :: 4 - Beta | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: Apache Software License | ||
Programming Language :: Python :: 2 | ||
Programming Language :: Python :: 2.7 | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.5 | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
License :: OSI Approved :: MIT License | ||
|
||
[options] | ||
zip_safe = True | ||
|
@@ -29,12 +28,21 @@ install_requires = | |
sqlparse | ||
colorama | ||
|
||
[options.packages.find] | ||
include = | ||
septentrion | ||
septentrion.* | ||
|
||
[options.entry_points] | ||
console_scripts = | ||
septentrion = septentrion.__main__:main | ||
|
||
[options.extras_require] | ||
dev = | ||
tox | ||
black | ||
isort | ||
github-changelog | ||
|
||
test = | ||
pytest | ||
|
@@ -45,9 +53,12 @@ test = | |
lint = | ||
black | ||
isort | ||
flake8 | ||
mypy | ||
check-manifest | ||
|
||
[bdist_wheel] | ||
universal = 1 | ||
[flake8] | ||
max-line-length = 88 | ||
|
||
[isort] | ||
multi_line_output=3 | ||
|
@@ -61,3 +72,13 @@ not_skip = __init__.py | |
|
||
[tool:pytest] | ||
addopts = --cov-report term-missing --cov-branch --cov-report html --cov-report term --cov=septentrion -vv | ||
|
||
[mypy-setuptools.*,colorama.*,psycopg2.*,sqlparse.*] | ||
ignore_missing_imports = True | ||
|
||
[coverage:report] | ||
exclude_lines = | ||
raise NotImplementedError | ||
coverage: exclude | ||
if TYPE_CHECKING: | ||
[ ]+\.\.\.$ |
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 |
---|---|---|
@@ -1,9 +1,8 @@ | ||
import os | ||
|
||
import psycopg2 | ||
from psycopg2 import sql | ||
|
||
import pytest | ||
from psycopg2 import sql | ||
|
||
|
||
@pytest.fixture | ||
|
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
https://pypi.org/project/github-changelog/