-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor the whole setup similar to Mezzanine
- Loading branch information
1 parent
8eb3b54
commit a4d18d3
Showing
13 changed files
with
328 additions
and
119 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,112 @@ | ||
name: Test and release | ||
|
||
# Fires on all incoming commits | ||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
|
||
# Test all supported Python & Django versions | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# Django 2.2 | ||
- tox-env: "py36-dj22" | ||
python-version: "3.6" | ||
- tox-env: "py37-dj22" | ||
python-version: "3.7" | ||
- tox-env: "py38-dj22" | ||
python-version: "3.8" | ||
- tox-env: "py39-dj22" | ||
python-version: "3.9" | ||
# Django 3.0 | ||
- tox-env: "py36-dj30" | ||
python-version: "3.6" | ||
- tox-env: "py37-dj30" | ||
python-version: "3.7" | ||
- tox-env: "py38-dj30" | ||
python-version: "3.8" | ||
- tox-env: "py39-dj30" | ||
python-version: "3.9" | ||
# Django 3.1 | ||
- tox-env: "py36-dj31" | ||
python-version: "3.6" | ||
- tox-env: "py37-dj31" | ||
python-version: "3.7" | ||
- tox-env: "py38-dj31" | ||
python-version: "3.8" | ||
- tox-env: "py39-dj31" | ||
python-version: "3.9" | ||
# Django 3.2 | ||
- tox-env: "py36-dj32" | ||
python-version: "3.6" | ||
- tox-env: "py37-dj32" | ||
python-version: "3.7" | ||
- tox-env: "py38-dj32" | ||
python-version: "3.8" | ||
- tox-env: "py39-dj32" | ||
python-version: "3.9" | ||
- tox-env: "py310-dj32" | ||
python-version: "3.10" | ||
# Django 4.0 | ||
- tox-env: "py38-dj40" | ||
python-version: "3.8" | ||
- tox-env: "py39-dj40" | ||
python-version: "3.9" | ||
- tox-env: "py310-dj40" | ||
python-version: "3.10" | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
run: pip install -U pip tox | ||
- name: Run tests | ||
run: tox -e ${{ matrix.tox-env }} | ||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v2 | ||
with: | ||
report_paths: '**/junit/TEST-*.xml' | ||
|
||
# Lint | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: pip install tox -U pip | ||
- name: Lint | ||
run: tox -e package -e lint -e pyupgrade | ||
|
||
# Create a new semantic release | ||
# Only runs on the original repo, not forks | ||
release: | ||
if: github.repository_owner == 'stephenmcd' | ||
needs: [test, lint] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '14' # https://github.com/cycjimmy/semantic-release-action/issues/79#issuecomment-955463633 | ||
- uses: cycjimmy/semantic-release-action@v2 | ||
with: | ||
semantic_version: 18 | ||
extra_plugins: | | ||
@semantic-release/exec@5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
TWINE_USERNAME: __token__ | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |
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,6 +1,25 @@ | ||
*.pyc | ||
*.pyo | ||
*.db | ||
*.egg-info | ||
.idea/ | ||
*.pot | ||
*.doctree | ||
*.swp | ||
.vscode | ||
.doctrees | ||
.DS_Store | ||
.coverage | ||
.idea/ | ||
.pytest_cache | ||
junit/ | ||
local_settings.py | ||
.eggs/ | ||
.tox/ | ||
Mezzanine.egg-info/ | ||
build/ | ||
docs/build/ | ||
docs/_build/ | ||
dist/ | ||
htmlcov/ | ||
mezzanine/project_template/static/ | ||
/mezzanine/.project | ||
/mezzanine/.pydevproject |
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,2 @@ | ||
[settings] | ||
profile = black |
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,19 @@ | ||
{ | ||
"branches": [ | ||
"+([0-9])?(.{+([0-9]),x}).x", | ||
"stable", | ||
{"name": "alpha", "prerelease": true}, | ||
{"name": "beta", "prerelease": true}, | ||
{"name": "rc", "prerelease": true} | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/github", | ||
["@semantic-release/exec", { | ||
"verifyConditionsCmd": "python -m pip install -U pip setuptools wheel twine", | ||
"prepareCmd": "sed -i 's/9999dev0/${nextRelease.version}/' mezzanine/__init__.py", | ||
"publishCmd": "python setup.py sdist bdist_wheel && twine upload dist/*" | ||
}] | ||
] | ||
} |
This file was deleted.
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
[main] | ||
host = https://www.transifex.com | ||
lang_map = sr@latin:sr_Latn | ||
|
||
[cartridge.default] | ||
file_filter = cartridge/shop/locale/<lang>/LC_MESSAGES/django.po | ||
source_file = cartridge/shop/locale/en/LC_MESSAGES/django.po | ||
source_lang = en | ||
trans.es = cartridge/shop/locale/es/LC_MESSAGES/django.po | ||
|
||
type = PO |
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,5 +1,11 @@ | ||
include CHANGELOG LICENSE README.rst | ||
include AUTHORS CHANGELOG LICENSE *.rst | ||
recursive-include docs * | ||
recursive-exclude docs/build * | ||
recursive-include cartridge * | ||
recursive-exclude */project_template/static * | ||
|
||
global-exclude __pycache__ | ||
global-exclude *.py[co] | ||
prune .tx | ||
prune tests | ||
exclude .releaserc .isort.cfg tox.ini pytest.ini .coveragerc |
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,13 @@ | ||
[tool.black] | ||
exclude = ''' | ||
( | ||
/( | ||
\.eggs | ||
| \.git | ||
| \.tox | ||
| \.venv | ||
| build | ||
| dist | ||
)/ | ||
) | ||
''' |
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,8 @@ | ||
[pytest] | ||
addopts = | ||
--tb short | ||
--cov=cartridge | ||
--cov-report html | ||
--cov-report term:skip-covered | ||
# Original coverage was 54% (not great), but at least ensure we don't go below | ||
--cov-fail-under 57 |
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,2 +1,60 @@ | ||
[wheel] | ||
universal = 1 | ||
[metadata] | ||
name = Cartridge | ||
version = attr: cartridge.__version__ | ||
description = AA Django shopping cart application. | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
author = Stephen McDonald | ||
author_email = [email protected] | ||
url = http://cartridge.jupo.org/ | ||
license = BSD | ||
license_file = LICENSE | ||
classifiers = | ||
Development Status :: 5 - Production/Stable | ||
Environment :: Web Environment | ||
Framework :: Django | ||
Intended Audience :: Developers | ||
License :: OSI Approved :: BSD License | ||
Operating System :: OS Independent | ||
Programming Language :: Python | ||
Programming Language :: Python :: 3 | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: 3.10 | ||
Framework :: Django | ||
Framework :: Django :: 2.2 | ||
Framework :: Django :: 3.0 | ||
Framework :: Django :: 3.1 | ||
Framework :: Django :: 3.2 | ||
Framework :: Django :: 4.0 | ||
Topic :: Internet :: WWW/HTTP | ||
Topic :: Internet :: WWW/HTTP :: Dynamic Content | ||
Topic :: Internet :: WWW/HTTP :: WSGI | ||
Topic :: Software Development :: Libraries :: Application Frameworks | ||
Topic :: Software Development :: Libraries :: Python Modules | ||
|
||
[options] | ||
python_requires = >=3.6 | ||
packages = cartridge | ||
include_package_data = true | ||
install_requires = | ||
mezzanine >= 5.1.1 | ||
xhtml2pdf | ||
|
||
[options.extras_require] | ||
stripe = stripe | ||
testing = | ||
pytest-django >= 4, <5 | ||
pytest-cov >= 2, < 3 | ||
codestyle = | ||
flake8 >= 3, <4 | ||
black==20.8b1 | ||
isort >= 5, <6 | ||
pyupgrade >= 2, <3 | ||
|
||
# Building | ||
|
||
[bdist_wheel] | ||
universal = 1 |
Oops, something went wrong.