Skip to content

Commit 31d5845

Browse files
committed
workflows
1 parent f330407 commit 31d5845

File tree

9 files changed

+261
-3
lines changed

9 files changed

+261
-3
lines changed

.github/workflows/change_log.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Changelog Entry
2+
on: [pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
check_file:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Check Chanelog Exists
14+
run: |
15+
if [[ $(ls ./changes/${{ github.event.number }}.*) ]]; then
16+
echo -e "\n"
17+
echo -e "\033[0;36mINFO: changelog for PR ${{ github.event.number }} exists.\033[0;0m"
18+
echo -e "\n"
19+
exit 0
20+
else
21+
echo -e "\n"
22+
echo -e "\033[0;31mERROR: changelog for PR ${{ github.event.number }} does not exist.\033[0;0m"
23+
echo -e "\n"
24+
exit 1
25+
fi
26+
27+
- name: Check Changelog Extension
28+
run: |
29+
fullfile=$(ls ./changes/${{ github.event.number }}.*)
30+
filename=$(basename -- "$fullfile")
31+
extension="${filename##*.}"
32+
allowed_types='[ "fix", "bugfix", "hotfix", "feature", "misc", "changes", "migration", "removal", "release" ]'
33+
if [[ $allowed_types =~ "\"$extension\"" ]]; then
34+
echo -e "\n"
35+
echo -e "\033[0;36mINFO: extension ${extension} accepted.\033[0;0m"
36+
echo -e "\n"
37+
exit 0
38+
else
39+
echo -e "\n"
40+
echo -e "\033[0;31mERROR: changelog file ending in ${extension} not supported.\033[0;0m"
41+
echo -e "\n"
42+
exit 1
43+
fi

.github/workflows/flake8.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Lint
2+
on: [push, pull_request]
3+
4+
permissions:
5+
contents: read
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-python@v2
13+
with:
14+
python-version: '3.9'
15+
- name: Install requirements
16+
run: pip install flake8 pycodestyle
17+
- name: Check syntax
18+
# Stop the build if there are Python syntax errors or undefined names
19+
run: flake8 --show-source
20+
21+
- name: Warnings
22+
run: flake8

.github/workflows/pyright.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Check types
2+
on: [push, pull_request]
3+
env:
4+
NODE_VERSION: '18'
5+
PYTHON_VERSION: '3.9'
6+
7+
permissions:
8+
contents: read
9+
10+
jobs:
11+
typecheck:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
id: gitcheckout
16+
- uses: actions/setup-python@v2
17+
with:
18+
python-version: ${{ env.PYTHON_VERSION }}
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: ${{ env.NODE_VERSION }}
22+
- name: Install python deps
23+
id: pydepends
24+
if: steps.gitcheckout.outcome == 'success'
25+
run: |
26+
python3 -m venv /home/runner/work/app
27+
mkdir -p /home/runner/work/app/src/ckanext-datastore-search
28+
cp -R . /home/runner/work/app/src/ckanext-datastore-search
29+
source /home/runner/work/app/bin/activate
30+
pip install --upgrade setuptools==70.0.0
31+
pip install --upgrade pip==23.2.1
32+
pip install -e 'git+https://github.com/ckan/ckan@master#egg=ckan' -r 'https://raw.githubusercontent.com/ckan/ckan/master/requirements.txt' -r 'https://raw.githubusercontent.com/ckan/ckan/master/dev-requirements.txt'
33+
pip install -e /home/runner/work/app/src/ckanext-datastore-search/. -r /home/runner/work/app/src/ckanext-datastore-search/requirements.txt
34+
pip install --upgrade setuptools==44.1.0
35+
find /home/runner/work/app -name '*.pyc' -delete
36+
- name: Install node deps
37+
if: steps.pydepends.outcome == 'success'
38+
run: |
39+
cd /home/runner/work/app/src/ckanext-datastore-search
40+
npm ci
41+
- name: Check types
42+
if: steps.pydepends.outcome == 'success'
43+
run: |
44+
cd /home/runner/work/app/src/ckanext-datastore-search
45+
npx pyright

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ sdist/
2020
*.egg-info/
2121
.installed.cfg
2222
*.egg
23+
node_modules/**
2324

2425
# PyInstaller
2526
# Usually these files are written by a python script from a template

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Tests](https://github.com/JVickery-TBS/ckanext-datastore-search/workflows/Tests/badge.svg?branch=main)](https://github.com/JVickery-TBS/ckanext-datastore-search/actions)
1+
[![Tests](https://github.com/open-data/ckanext-datastore-search/workflows/Tests/badge.svg?branch=main)](https://github.com/open-data/ckanext-datastore-search/actions)
22

33
# CKANEXT DataStore Search
44

@@ -11,7 +11,7 @@ https://github.com/ckan/ckan/pull/8684
1111

1212
**If using the SOLR engine:**
1313
- SOLR 9+ running in Stand Alone mode. Currently, this plugin does NOT support Cloud Mode SOLR.
14-
- [Python SOLR Utils](https://github.com/JVickery-TBS/pysolr-utils) installed and service running on a SOLR server.
14+
- [Python SOLR Utils](https://github.com/open-data/pysolr-utils) installed and service running on a SOLR server.
1515
- A `ckan -c <INI> jobs worker ckan_ds_create_index_callback` service running on a CKAN server. *See: ckanext.datastore_search.redis.callback_queue_name below*
1616

1717
Compatibility with core CKAN versions:
@@ -60,7 +60,7 @@ To install ckanext-datastore-search:
6060

6161
2. Clone the source and install it on the virtualenv:
6262
```
63-
git clone https://github.com/JVickery-TBS/ckanext-datastore-search.git
63+
git clone https://github.com/open-data/ckanext-datastore-search.git
6464
cd ckanext-datastore-search
6565
pip install -e .
6666
pip install -r requirements.txt

package-lock.json

Lines changed: 46 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"name": "ckanext-datastore-search",
3+
"version": "1.0.0",
4+
"description": "CKAN plugin to create search indices for DataStore resources",
5+
"dependencies": {},
6+
"devDependencies": {
7+
"pyright": "1.1.386"
8+
},
9+
"scripts": {},
10+
"repository": {
11+
"type": "git",
12+
"url": "git+https://github.com/open-data/ckanext-datastore-search.git"
13+
},
14+
"keywords": [],
15+
"author": "",
16+
"license": "MIT",
17+
"bugs": {
18+
"url": "https://github.com/open-data/ckanext-datastore-search/issues"
19+
},
20+
"homepage": "https://github.com/open-data/ckanext-datastore-search#readme"
21+
}

pyproject.toml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
[tool.pyright]
2+
pythonVersion = "3.9"
3+
include = ["ckanext"]
4+
exclude = [
5+
"**/tests",
6+
"**/migration",
7+
]
8+
extraPaths = [
9+
"../../lib/python3.9/site-packages",
10+
"../.",
11+
"../ckan",
12+
]
13+
strict = []
14+
strictParameterNoneValue = true
15+
reportFunctionMemberAccess = true
16+
reportMissingImports = true
17+
reportMissingModuleSource = true
18+
reportMissingTypeStubs = false
19+
reportImportCycles = false
20+
reportUnusedImport = true
21+
reportUnusedClass = true
22+
reportUnusedFunction = true
23+
reportUnusedVariable = true
24+
reportDuplicateImport = true
25+
reportOptionalSubscript = true
26+
reportOptionalMemberAccess = true
27+
reportOptionalCall = true
28+
reportOptionalIterable = true
29+
reportOptionalContextManager = true
30+
reportOptionalOperand = true
31+
reportTypedDictNotRequiredAccess = false
32+
reportConstantRedefinition = true
33+
reportIncompatibleMethodOverride = false
34+
reportIncompatibleVariableOverride = true
35+
reportOverlappingOverload = true
36+
reportUntypedFunctionDecorator = false
37+
reportUnknownParameterType = true
38+
reportUnknownArgumentType = false
39+
reportUnknownLambdaType = false
40+
reportUnknownMemberType = false
41+
reportMissingTypeArgument = true
42+
reportInvalidTypeVarUse = true
43+
reportCallInDefaultInitializer = true
44+
reportUnknownVariableType = false
45+
reportUntypedBaseClass = true
46+
reportUnnecessaryIsInstance = true
47+
reportUnnecessaryCast = true
48+
reportUnnecessaryComparison = true
49+
reportAssertAlwaysTrue = true
50+
reportSelfClsParameterName = true
51+
reportUnusedCallResult = false
52+
useLibraryCodeForTypes = true
53+
reportGeneralTypeIssues = true
54+
reportPropertyTypeMismatch = true
55+
reportWildcardImportFromLibrary = true
56+
reportUntypedClassDecorator = false
57+
reportUntypedNamedTuple = true
58+
reportPrivateUsage = false
59+
reportPrivateImportUsage = true
60+
reportInconsistentConstructor = true
61+
reportMissingSuperCall = false
62+
reportUninitializedInstanceVariable = false
63+
reportInvalidStringEscapeSequence = true
64+
reportMissingParameterType = true
65+
reportImplicitStringConcatenation = false
66+
reportUndefinedVariable = true
67+
reportUnboundVariable = true
68+
reportInvalidStubStatement = true
69+
reportIncompleteStub = true
70+
reportUnsupportedDunderAll = true
71+
reportUnusedCoroutine = true
72+
reportUnnecessaryTypeIgnoreComment = true
73+
reportMatchNotExhaustive = true

setup.cfg

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,10 @@ filterwarnings =
6060
ignore::sqlalchemy.exc.SAWarning
6161
ignore::DeprecationWarning
6262
addopts = --ckan-ini test.ini
63+
64+
[flake8]
65+
max-complexity = 100
66+
max-line-length = 88
67+
count = true
68+
exit-zero = true
69+
statistics = true

0 commit comments

Comments
 (0)