Skip to content

Commit

Permalink
Merge pull request #5 from RegioneER/add_metadata
Browse files Browse the repository at this point in the history
populate getRemoteUrl metadata
  • Loading branch information
cekk authored Jul 18, 2024
2 parents 60325ec + 0ae6dde commit 3a2f36e
Show file tree
Hide file tree
Showing 39 changed files with 498 additions and 480 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

# 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
10 changes: 10 additions & 0 deletions .github/workflows/isort.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Run isort
on:
- push

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: isort/isort-action@v1
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 .
67 changes: 67 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Tests

on:
push:
paths-ignore:
- '**.md'
- '**.rst'
jobs:
build:
runs-on: ubuntu-latest
strategy:
max-parallel: 4
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
plone: ["52", "60"]
tz: ["UTC", "Europe/Rome"]
exclude:
- python: "3.10"
plone: "52"
- python: "3.11"
plone: "52"
steps:
- uses: actions/checkout@v3
- name: Cache eggs
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@v3
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
pip install -r requirements.txt -c constraints_plone${{ matrix.plone }}.txt
cp test_plone${{ matrix.plone }}.cfg buildout.cfg
- name: Install buildout
run: |
buildout -N code-analysis:return-status-codes=True
- name: Code analysis
run: |
bin/code-analysis
- name: Run tests
run: |
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
18 changes: 13 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
__pycache__
.DS_Store
pyvenv.cfg
.coverage
coverage.json
.python-version
*.egg-info
*.EGG-INFO
*.egg
*.EGG
*.log
*.mo
*.py?
*.swp
# dirs
__pycache__
bin/
buildout-cache/
develop-eggs/
Expand All @@ -16,8 +19,10 @@ htmlcov/
include/
lib/
local/
node_modules/
parts/
src/*
dist/*
test.plone_addon/
var/
# files
Expand All @@ -28,12 +33,15 @@ log.html
output.xml
pip-selfcheck.json
report.html
.vscode/
.tox/
reports/
# excludes
!.coveragerc
!.editorconfig
!.gitattributes
!.gitignore
!.gitkeep
!.travis.yml
!src/rer
.DS_Store
!src/redturtle
.idea/
35 changes: 24 additions & 11 deletions base.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ parts =
omelette
robot
plone-helper-scripts
develop = .

develop = .
sources-dir = extras
auto-checkout = *
always-checkout = force

[instance]
recipe = plone.recipe.zope2instance
Expand All @@ -29,12 +32,24 @@ environment-vars =
eggs =
Plone
Pillow
rer.externalnews [test]

rer.externalnews[test]

zcml-additional =
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:plone="http://namespaces.plone.org/plone">
<plone:CORSPolicy
allow_origin="http://localhost:3000,http://127.0.0.1:3000"
allow_methods="DELETE,GET,OPTIONS,PATCH,POST,PUT"
allow_credentials="true"
expose_headers="Content-Length,X-My-Header"
allow_headers="Accept,Authorization,Content-Type,X-Custom-Header,Origin"
max_age="3600"
/>
</configure>

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


Expand All @@ -46,8 +61,6 @@ eggs = ${instance:eggs}
[test]
recipe = zc.recipe.testrunner
eggs = ${instance:eggs}
initialization =
os.environ['TZ'] = 'UTC'
defaults = ['-s', 'rer.externalnews', '--auto-color', '--auto-progress']


Expand All @@ -60,10 +73,12 @@ eggs = 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=60
# ${buildout:directory}/bin/coverage report -m --fail-under=90
# Fail (exit status 1) if coverage returns exit status 2 (this happens
# when test coverage is below 100%.
output = ${buildout:directory}/bin/test-coverage
Expand Down Expand Up @@ -104,6 +119,4 @@ scripts =
[versions]
# Don't use a released version of rer.externalnews
rer.externalnews =

[sources]
plone.formwidget.contenttree = git https://github.com/plone/plone.formwidget.contenttree.git
setuptools =
5 changes: 1 addition & 4 deletions buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,4 @@

# use this extend one of the buildout configuration:
extends =
# test_plone43.cfg
# test_plone50.cfg
# test_plone51.cfg
test_plone52.cfg
test_plone60.cfg
2 changes: 1 addition & 1 deletion constraints.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
-c constraints_plone52.txt
-c constraints_plone60.txt
2 changes: 0 additions & 2 deletions constraints_plone50.txt

This file was deleted.

2 changes: 0 additions & 2 deletions constraints_plone51.txt

This file was deleted.

5 changes: 3 additions & 2 deletions constraints_plone52.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
setuptools==40.2.0
zc.buildout==2.12.2
-c https://dist.plone.org/release/5.2-latest/requirements.txt
# setuptools==40.2.0
# zc.buildout==2.13.2
1 change: 1 addition & 0 deletions constraints_plone60.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-c https://dist.plone.org/release/6.0-latest/requirements.txt
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
-c constraints_plone52.txt
pip
setuptools
zc.buildout
wheel
Loading

0 comments on commit 3a2f36e

Please sign in to comment.