Skip to content

Commit

Permalink
Merge pull request #5 from RedTurtle/absolute_url
Browse files Browse the repository at this point in the history
feat: absolute urls
  • Loading branch information
cekk authored Jan 17, 2024
2 parents 5f98ad5 + 8f1b0c1 commit 27513d5
Show file tree
Hide file tree
Showing 27 changed files with 485 additions and 228 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/black.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Black
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]

steps:
# git checkout
- uses: actions/checkout@v2

# python setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

# python cache
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# install black
- name: install black
run: pip install black==21.12b0 click==8.0.4

# run black
- name: run black
run: black src/ --check --diff
35 changes: 35 additions & 0 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Flake8
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]

steps:
# git checkout
- uses: actions/checkout@v2

# python setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

# python cache
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# install flake8
- name: install flake8
run: pip install flake8

# run black
- name: run flake8
run: flake8 src/ setup.py
35 changes: 35 additions & 0 deletions .github/workflows/pyroma.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Pyroma
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]

steps:
# git checkout
- uses: actions/checkout@v2

# python setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

# python cache
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# install pyroma
- name: install pyroma
run: pip install pyroma

# run pyroma
- name: run pyroma
run: pyroma -n 10 -d .
51 changes: 39 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,32 @@
name: Tests

on: [push]

on:
push:
paths-ignore:
- "**.md"
- "**.rst"
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python: ["3.7"]
plone: ["52"]
# exclude:
# - python: "3.7"
# plone: "51"
python: ["3.8", "3.9", "3.10", "3.11"]
plone: ["52", "60"]
exclude:
- python: "3.10"
plone: "52"
- python: "3.11"
plone: "52"
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Cache eggs
uses: actions/cache@v1
uses: actions/cache@v3
with:
path: eggs
key: ${{ runner.OS }}-build-python${{ matrix.python }}-${{ matrix.plone }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
Expand All @@ -30,10 +35,32 @@ jobs:
cp test_plone${{ matrix.plone }}.cfg buildout.cfg
- name: Install buildout
run: |
buildout -N -t 3 code-analysis:return-status-codes=True
buildout -N code-analysis:return-status-codes=True
- name: Code analysis
run: |
bin/code-analysis
- name: Run tests
run: |
bin/test
bin/test-coverage
env:
PROXY_BEARER_AUTH: on
TZ: ${{ matrix.tz }}
- name: Upload coverage data to coveralls.io
run: |
pip install coveralls
coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: py${{ matrix.python }}-plone${{ matrix.plone }}-tz${{ matrix.tz }}
COVERALLS_PARALLEL: true

coveralls_finish:
needs: build
runs-on: ubuntu-latest
steps:
- name: Finished
run: |
pip install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/zpretty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: zpretty
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8]

steps:
# git checkout
- uses: actions/checkout@v2

# python setup
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}

# python cache
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
# install zpretty
- name: install zpretty
run: pip install zpretty

# run zpretty
- name: run zpretty
run: find src -name '*.zcml' | xargs zpretty -i

# XXX: this doesn't work on gh actions (https://github.com/plone/plone.restapi/pull/1119/checks?check_run_id=2686474411)
# run git diff
- name: run git diff
run: git diff --exit-code
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ report.html
.vscode/
.tox/
reports/
pyvenv.cfg
# excludes
!.coveragerc
!.editorconfig
Expand Down
3 changes: 2 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Changelog
1.1.3 (unreleased)
------------------

- Nothing changed yet.
- absolut-ize urls
[mamico]


1.1.2 (2023-03-17)
Expand Down
97 changes: 58 additions & 39 deletions base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ parts =
instance
test
code-analysis
coverage
test-coverage
createcoverage
releaser
i18ndude
omelette
robot
plone-helper-scripts
develop = .
zpretty
zpretty-run
createcoverage
coverage
test-coverage

develop = .

[instance]
recipe = plone.recipe.zope2instance
Expand All @@ -31,7 +32,7 @@ eggs =
Pillow
redturtle.voltoplugin.editablefooter [test]

zcml-additional +=
zcml-additional =
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:plone="http://namespaces.plone.org/plone">
<plone:CORSPolicy
Expand All @@ -46,9 +47,21 @@ zcml-additional +=

[code-analysis]
recipe = plone.recipe.codeanalysis
directory = ${buildout:directory}/src/redturtle
return-status-codes = False

directory = ${buildout:directory}/src
flake8-exclude=bootstrap.py,bootstrap-buildout.py,docs,bin,*.egg,setup.py,overrides,omelette
flake8-max-complexity = 25
flake8-ignore = E203, E266, E501, W503, E999
flake8-max-line-length = 200
# flake8-select = B,C,E,F,W,T4,B9
flake8-extensions =
flake8-coding
flake8-debugger
flake8-print
# flake8-isort
# additional pep8/flake8 rules, see docs for details
# https://pep8.readthedocs.io/en/1.4.6/intro.html#error-codes
# - E123: closing bracket does not match indentation of opening bracket’s line
# flake8-select = E123

[omelette]
recipe = collective.recipe.omelette
Expand All @@ -63,56 +76,62 @@ initialization =
defaults = ['-s', 'redturtle.voltoplugin.editablefooter', '--auto-color', '--auto-progress']


[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser


[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude

[plone-helper-scripts]
recipe = zc.recipe.egg
eggs =
Products.CMFPlone
${instance:eggs}
interpreter = zopepy
scripts =
zopepy
plone-compile-resources

[zpretty]
recipe = zc.recipe.egg
eggs =
zpretty

[zpretty-run]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
find src -name '*.zcml' | xargs bin/zpretty -i
output = ${buildout:directory}/bin/zpretty-run
mode = 755

[coverage]
recipe = zc.recipe.egg
eggs = coverage


[test-coverage]
recipe = collective.recipe.template
input = inline:
#!/bin/bash
set -e
export TZ=UTC
${buildout:directory}/bin/coverage run bin/test $*
${buildout:directory}/bin/coverage html
${buildout:directory}/bin/coverage report -m --fail-under=90
${buildout:directory}/bin/coverage report -m --fail-under=75
# Fail (exit status 1) if coverage returns exit status 2 (this happens
# when test coverage is below 100%.
${buildout:directory}/bin/coverage json -i
output = ${buildout:directory}/bin/test-coverage
mode = 755


[createcoverage]
recipe = zc.recipe.egg
eggs = createcoverage


[robot]
recipe = zc.recipe.egg
eggs =
${test:eggs}
plone.app.robotframework[debug,reload]


[releaser]
recipe = zc.recipe.egg
eggs = zest.releaser


[i18ndude]
recipe = zc.recipe.egg
eggs = i18ndude

[plone-helper-scripts]
recipe = zc.recipe.egg
eggs =
Products.CMFPlone
${instance:eggs}
interpreter = zopepy
scripts =
zopepy
plone-compile-resources

[versions]
# Don't use a released version of redturtle.voltoplugin.editablefooter
redturtle.voltoplugin.editablefooter =
setuptools =
Loading

0 comments on commit 27513d5

Please sign in to comment.