1
0
mirror of https://github.com/ilri/dspace-statistics-api.git synced 2024-11-27 00:28:17 +01:00

Compare commits

...

4 Commits

Author SHA1 Message Date
7680b0f440
.github: update workflow
All checks were successful
continuous-integration/drone/push Build is passing
- actions/checkout@v4
- actions/setup-python@v5
- python-version: '3.11'
2023-12-09 13:58:01 +03:00
e70a7a9675
Apply fixes from fixit
RewriteToLiteral: It's slower to call list() than using the empty literal
2023-12-09 13:57:55 +03:00
24f90df13e
pyprojecy.toml: use new group syntax
poetry wants us to use `poetry add --group=dev` now, which generates
this syntax in the toml.
2023-12-09 13:57:45 +03:00
780f2c1723
pyproject.toml: add fixit to dev dependencies 2023-12-09 13:57:31 +03:00
4 changed files with 9 additions and 8 deletions

View File

@ -30,9 +30,9 @@ jobs:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Install poetry - name: Install poetry
run: pipx install poetry run: pipx install poetry
- uses: actions/setup-python@v4 - uses: actions/setup-python@v5
with: with:
python-version: '3.10' python-version: '3.11'
cache: 'poetry' cache: 'poetry'
- run: poetry install - run: poetry install
- name: Lint with flake8 - name: Lint with flake8

View File

@ -90,7 +90,7 @@ class AllStatisticsResource:
) )
# create a list to hold dicts of stats # create a list to hold dicts of stats
statistics = list() statistics = []
# iterate over results and build statistics object # iterate over results and build statistics object
for result in cursor: for result in cursor:
@ -162,7 +162,7 @@ class AllStatisticsResource:
) )
# create a list to hold dicts of stats # create a list to hold dicts of stats
statistics = list() statistics = []
# iterate over views dict to extract views and use the element id as an # iterate over views dict to extract views and use the element id as an
# index to the downloads dict to extract downloads. # index to the downloads dict to extract downloads.

View File

@ -140,7 +140,7 @@ def validate_post_parameters(req, resp, resource, params):
description=f'The "{req.context.statistics_scope}" parameter is invalid. The value must be a comma-separated list of UUIDs.', description=f'The "{req.context.statistics_scope}" parameter is invalid. The value must be a comma-separated list of UUIDs.',
) )
else: else:
req.context.elements = list() req.context.elements = []
def set_statistics_scope(req, resp, resource, params): def set_statistics_scope(req, resp, resource, params):

View File

@ -13,11 +13,12 @@ psycopg2 = "^2.9.1"
requests = "^2.24.0" requests = "^2.24.0"
falcon-swagger-ui = {git = "https://github.com/alanorth/falcon-swagger-ui.git", rev="falcon3-update-swagger-ui"} falcon-swagger-ui = {git = "https://github.com/alanorth/falcon-swagger-ui.git", rev="falcon3-update-swagger-ui"}
[tool.poetry.dev-dependencies] [tool.poetry.group.dev.dependencies]
flake8 = "^6.0.0"
pytest = "^7.0.0"
black = "^23.0.0" black = "^23.0.0"
fixit = "^2.1.0"
flake8 = "^6.0.0"
isort = "^5.9.1" isort = "^5.9.1"
pytest = "^7.0.0"
[build-system] [build-system]
requires = ["poetry>=0.12"] requires = ["poetry>=0.12"]