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

bump major #329

Merged
merged 5 commits into from
Dec 5, 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
27 changes: 4 additions & 23 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,7 @@ on:

jobs:
Publish:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel babel
- name: Build package
run: |
python setup.py compile_catalog sdist bdist_wheel
- name: Publish on PyPI
uses: pypa/[email protected]
with:
user: __token__
# The token is provided by the inveniosoftware organization
password: ${{ secrets.pypi_token }}
uses: inveniosoftware/workflows/.github/workflows/pypi-publish.yml@master
secrets: inherit
with:
babel-compile-catalog: true
7 changes: 7 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
..
This file is part of Invenio.
Copyright (C) 2015-2024 CERN.
Copyright (C) 2024 Graz University of Technology.
Invenio is free software; you can redistribute it and/or modify it
under the terms of the MIT License; see LICENSE file for more details.

Changes
=======

Version 3.0.0 (released 2024-12-05)

- fix: IndexError: negative indexes not allowed
- setup: change to reusable workflows
- setup: bump major dependencies

Version v2.4.1 (released 2024-11-05)

- model: make forward compatible to sqlalchemy >= 2
Expand Down
7 changes: 5 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2015-2018 CERN.
# Copyright (C) 2022 Graz University of Technology.
# Copyright (C) 2022-2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand Down Expand Up @@ -337,5 +337,8 @@
(
"py:class",
"invenio_records.systemfields.relations.modelrelations.ModelRelationResult",
), # noqa
),
("py:class", "t.ClassVar"),
("py:class", "Query"),
("py:attr", "query_class"), # noqa
]
2 changes: 1 addition & 1 deletion invenio_records/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@
from .api import Record
from .ext import InvenioRecords

__version__ = "2.4.1"
__version__ = "3.0.0"

__all__ = (
"InvenioRecords",
Expand Down
11 changes: 8 additions & 3 deletions invenio_records/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ def revert(self, revision_id):
if self.model is None:
raise MissingModelError()

revision = self.revisions[revision_id]
revision = list(self.revisions)[revision_id]

with db.session.begin_nested():
if self.send_signals:
Expand Down Expand Up @@ -635,7 +635,7 @@ def __getitem__(self, revision_id):
instances having to be updated.)
"""
if revision_id < 0:
return RecordRevision(self.model.versions[revision_id])
return RecordRevision(list(self.model.versions)[revision_id])
try:
return RecordRevision(
self.model.versions.filter_by(version_id=revision_id + 1).one()
Expand All @@ -654,4 +654,9 @@ def __contains__(self, revision_id):
def __reversed__(self):
"""Allows to use reversed operator."""
for version_index in range(self.model.versions.count()):
yield RecordRevision(self.model.versions[-(version_index + 1)])
versions = (
list(self.model.versions)
if -(version_index + 1) < 0
else self.model.versions
)
yield RecordRevision(versions[-(version_index + 1)])
16 changes: 8 additions & 8 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This file is part of Invenio.
# Copyright (C) 2015-2022 CERN.
# Copyright (C) 2021 TU Wien.
# Copyright (C) 2022 Graz University of Technology.
# Copyright (C) 2022-2024 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
Expand All @@ -29,28 +29,28 @@ python_requires = >=3.7
zip_safe = False
install_requires =
arrow>=0.16.0
invenio-celery>=1.2.4,<2.0.0
invenio-i18n>=2.0.0,<3.0.0
invenio-celery>=2.0.0,<3.0.0
invenio-i18n>=3.0.0,<4.0.0
jsonpatch>=1.26
jsonref>=0.2
jsonresolver>=0.3.1
jsonschema>=4.3.0,<5.0.0

[options.extras_require]
tests =
pytest-black>=0.3.0
pytest-black-ng>=0.4.0
invenio-admin>=1.4.0,<2.0.0
pytest-invenio>=2.1.0,<3.0.0
pytest-invenio>=3.0.0,<4.0.0
pytest-mock>=1.6.0
sphinx>=4.5.0
admin =
invenio-admin>=1.2.1,<2.0.0
mysql =
invenio-db[mysql,versioning]>=1.0.14,<2.0.0
invenio-db[mysql,versioning]>=2.0.0,<3.0.0
postgresql =
invenio-db[postgresql,versioning]>=1.0.14,<2.0.0
invenio-db[postgresql,versioning]>=2.0.0,<3.0.0
sqlite =
invenio-db[versioning]>=1.0.14,<2.0.0
invenio-db[versioning]>=2.0.0,<3.0.0
docs =
# Kept for backwards compatibility

Expand Down