Skip to content
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

reuse github actions from superdesk/superdesk repo #6

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .github/workflows/lint.yml

This file was deleted.

56 changes: 3 additions & 53 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,10 @@ on: [push, pull_request]
jobs:

server:

strategy:
matrix:
python-version: ['3.8', '3.10']

runs-on: ubuntu-latest

defaults:
run:
working-directory: server

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- run: |
sudo apt-get update
sudo apt-get -y install libxml2-dev libxmlsec1-dev libxmlsec1-openssl libexempi-dev

- run: |
python -m pip install --upgrade pip wheel setuptools
python -m pip install -r dev-requirements.txt
uses: superdesk/superdesk/.github/workflows/server.yml@develop

client:
uses: superdesk/superdesk/.github/workflows/client.yml@develop

strategy:
matrix:
node-version: ['12.x', '14.x']

runs-on: ubuntu-latest

defaults:
run:
working-directory: client

steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}

- run: npm install

- run: npm run build

docker:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- run: docker-compose build
uses: superdesk/superdesk/.github/workflows/docker.yml@develop
4 changes: 2 additions & 2 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM ubuntu:20.04
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends \
python3 python3-dev python3-pip python3-venv git gcc mongo-tools mongodb-clients curl \
python3 python3-dev python3-pip python3-venv git gcc curl \
# lxml
libxml2-dev libxslt-dev \
# PIL
Expand Down
22 changes: 0 additions & 22 deletions server/data_updates/00002_20160803-171643_validators.py

This file was deleted.

23 changes: 0 additions & 23 deletions server/data_updates/00003_20160829-094134_validators.py

This file was deleted.

24 changes: 0 additions & 24 deletions server/data_updates/00004_20171026-103118_content_types.py

This file was deleted.

39 changes: 0 additions & 39 deletions server/data_updates/00005_20181114-090110_vocabularies.py

This file was deleted.

14 changes: 8 additions & 6 deletions server/dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
-r requirements.txt

flake8
nose
pep8
httmock
wooper
mypy
black==23.12.1
pep8==1.7.1
flake8==7.1.1
pytest==8.3.3
httmock==1.4.0
wooper==0.4.4
mypy==1.13.0
responses==0.25.3
4 changes: 2 additions & 2 deletions server/gunicorn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
accesslog = "-"
access_log_format = "%(m)s %(U)s status=%(s)s time=%(T)ss size=%(B)sb"

reload = 'SUPERDESK_RELOAD' in os.environ
timeout = int(os.environ.get('WEB_TIMEOUT', 30))
reload = "SUPERDESK_RELOAD" in os.environ
timeout = int(os.environ.get("WEB_TIMEOUT", 30))
24 changes: 12 additions & 12 deletions server/macros/replace_words.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def repl(new, old):
return new.title()
# it is more complex so try to match it
else:
result = ''
result = ""
all_upper = True
for i, c in enumerate(old):
if i >= len(new):
Expand All @@ -52,20 +52,20 @@ def repl(new, old):
all_upper = False
# append any remaining characters from new
if all_upper:
result += new[i + 1:].upper()
result += new[i + 1 :].upper()
else:
result += new[i + 1:].lower()
result += new[i + 1 :].lower()
return result

def do_find_replace(input_string, words_list):
found_list = {}
for word in words_list:
pattern = r'{}'.format(re.escape(word.get('existing', '')))
pattern = r"{}".format(re.escape(word.get("existing", "")))

while re.search(pattern, input_string, flags=re.IGNORECASE):
# get the original string from the input
original = re.search(pattern, input_string, flags=re.IGNORECASE).group(0)
replacement = repl(word.get('replacement', ''), original)
replacement = repl(word.get("replacement", ""), original)
if found_list.get(original):
break
diff[original] = replacement
Expand All @@ -74,10 +74,10 @@ def do_find_replace(input_string, words_list):

return input_string

vocab = get_resource_service('vocabularies').find_one(req=None, _id='replace_words')
vocab = get_resource_service("vocabularies").find_one(req=None, _id="replace_words")

if vocab:
replace_words_list = vocab.get('items') or []
replace_words_list = vocab.get("items") or []

if not replace_words_list:
return item
Expand All @@ -91,10 +91,10 @@ def do_find_replace(input_string, words_list):
return item


name = 'Replace_Words'
label = 'Replace words in the article'
name = "Replace_Words"
label = "Replace words in the article"
order = 1
shortcut = 'a'
shortcut = "a"
callback = find_and_replace
access_type = 'frontend'
action_type = 'direct'
access_type = "frontend"
action_type = "direct"
1 change: 1 addition & 0 deletions server/requirements.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
honcho
gunicorn
pyparsing<3.2

git+https://github.com/superdesk/[email protected]#egg=superdesk-core
git+https://github.com/superdesk/[email protected]#egg=superdesk-planning
Expand Down
10 changes: 6 additions & 4 deletions server/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ blinker==1.8.2
# flask-mail
# raven
# superdesk-core
boto3==1.35.59
boto3==1.35.60
# via superdesk-core
botocore==1.35.59
botocore==1.35.60
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -199,8 +199,10 @@ pymongo==3.11.4
# eve
# mongolock
# superdesk-core
pyparsing==3.2.0
# via httplib2
pyparsing==3.1.4
# via
# -r requirements.in
# httplib2
python-dateutil==2.9.0.post0
# via
# arrow
Expand Down
3 changes: 2 additions & 1 deletion server/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
max-line-length = 120
exclude = env,bin,lib,include,src
ignore = F811,D200,D202,D205,D400,D401,D100,D101,D102,D103,D104,D105,D107,W503,W504,W605,F401,E261,F841
extend-ignore = E203

[mypy]
python_version = 3.6
python_version = 3.8
allow_untyped_globals = True
ignore_missing_imports = True