Skip to content
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
9 changes: 8 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
..
This file is part of Invenio.
Copyright (C) 2016-2025 CERN.
Copyright (C) 2024-2025 Graz University of Technology.
Copyright (C) 2024-2026 Graz University of Technology.

Invenio is free software; you can redistribute it
and/or modify it under the terms of the GNU General Public License as
Expand All @@ -26,6 +26,13 @@
Changes
=======

Version v5.0.0 (released 2026-01-29)

- chore(black): update formatting to >= 26.0
- chore(setup): bump dependencies
- fix(chore): DeprecationWarning stdlib
- Update release date for version v4.0.0

Version v4.0.0 (released 2025-11-12)

- setup: bump major version of `invenio-oauthclient`
Expand Down
4 changes: 2 additions & 2 deletions invenio_github/__init__.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) 2023-2025 CERN.
# Copyright (C) 2024-2025 Graz University of Technology.
# Copyright (C) 2024-2026 Graz University of Technology.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
Expand All @@ -27,6 +27,6 @@

from .ext import InvenioGitHub

__version__ = "4.0.0"
__version__ = "5.0.0"

__all__ = ("__version__", "InvenioGitHub")
34 changes: 34 additions & 0 deletions invenio_github/alembic/2f62e6442a08_change_datetime_types.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
# Copyright (C) 2026 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.

"""Change expires_at type to utc aware datetime."""

from invenio_db.utils import (
update_table_columns_column_type_to_datetime,
update_table_columns_column_type_to_utc_datetime,
)

# revision identifiers, used by Alembic.
revision = "2f62e6442a08"
down_revision = "b0eaee37b545"
branch_labels = ()
depends_on = None


def upgrade():
"""Upgrade database."""
for table_name in ["github_repositories", "github_releases"]:
update_table_columns_column_type_to_utc_datetime(table_name, "created")
update_table_columns_column_type_to_utc_datetime(table_name, "updated")


def downgrade():
"""Downgrade database."""
for table_name in ["github_repositories", "github_releases"]:
update_table_columns_column_type_to_datetime(table_name, "created")
update_table_columns_column_type_to_datetime(table_name, "updated")
6 changes: 3 additions & 3 deletions invenio_github/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2023 CERN.
# Copyright (C) 2026 Graz University of Technology.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -32,7 +33,6 @@
from invenio_i18n import lazy_gettext as _
from invenio_webhooks.models import Event
from sqlalchemy.dialects import postgresql
from sqlalchemy_utils.models import Timestamp
from sqlalchemy_utils.types import ChoiceType, JSONType, UUIDType

RELEASE_STATUS_TITLES = {
Expand Down Expand Up @@ -107,7 +107,7 @@ def color(self):
return RELEASE_STATUS_COLOR[self.name]


class Repository(db.Model, Timestamp):
class Repository(db.Model, db.Timestamp):
"""Information about a GitHub repository."""

__tablename__ = "github_repositories"
Expand Down Expand Up @@ -203,7 +203,7 @@ def __repr__(self):
return "<Repository {self.name}:{self.github_id}>".format(self=self)


class Release(db.Model, Timestamp):
class Release(db.Model, db.Timestamp):
"""Information about a GitHub release."""

__tablename__ = "github_releases"
Expand Down
1 change: 0 additions & 1 deletion invenio_github/oauth/remote_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
# it under the terms of the MIT License; see LICENSE file for more details.
"""Github oauth app implementation for github integration."""


from invenio_oauthclient.contrib.github import GitHubOAuthSettingsHelper

from invenio_github.oauth.handlers import account_setup_handler, disconnect_handler
Expand Down
3 changes: 2 additions & 1 deletion invenio_github/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# This file is part of Invenio.
# Copyright (C) 2023 CERN.
# Copyright (C) 2024 KTH Royal Institute of Technology.
# Copyright (C) 2026 Graz University of Technology.
#
# Invenio is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -154,7 +155,7 @@ def refresh_accounts(expiration_threshold=None):
:param expiration_threshold: Dictionary containing timedelta parameters
referring to the maximum inactivity time.
"""
expiration_date = datetime.datetime.utcnow() - datetime.timedelta(
expiration_date = datetime.datetime.now(datetime.timezone.utc) - datetime.timedelta(
**(expiration_threshold or {"days": 6 * 30})
)

Expand Down
8 changes: 4 additions & 4 deletions invenio_github/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2023 CERN.
# Copyright (C) 2026 Graz University of Technology.
#
# Invenio is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
Expand All @@ -19,17 +20,16 @@

"""Various utility functions."""

from datetime import datetime
from datetime import datetime, timezone

import dateutil.parser
import pytz
import six
from werkzeug.utils import import_string


def utcnow():
"""UTC timestamp (with timezone)."""
return datetime.now(tz=pytz.utc)
return datetime.now(tz=timezone.utc)


def iso_utcnow():
Expand All @@ -41,7 +41,7 @@ def parse_timestamp(x):
"""Parse ISO8601 formatted timestamp."""
dt = dateutil.parser.parse(x)
if dt.tzinfo is None:
dt = dt.replace(tzinfo=pytz.utc)
dt = dt.replace(tzinfo=timezone.utc)
return dt


Expand Down
30 changes: 15 additions & 15 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# This file is part of Invenio.
# Copyright (C) 2023-2025 CERN.
# Copyright (C) 2023-2025 Graz University of Technology.
# Copyright (C) 2023-2026 Graz University of Technology.
#
# Invenio is free software; you can redistribute it
# and/or modify it under the terms of the GNU General Public License as
Expand Down Expand Up @@ -49,31 +49,31 @@ install_requires =
github3.py>=4.0.1,<5.0.0
humanize>=0.5.1
invenio-assets>=4.0.0,<5.0.0
invenio-accounts>=6.0.0,<7.0.0
invenio-accounts>=7.0.0,<8.0.0
invenio-celery>=2.0.0,<3.0.0
invenio-db>=2.0.0,<3.0.0
invenio-formatter>=3.0.0,<4.0.0
invenio-db>=2.2.0,<3.0.0
invenio-formatter>=4.0.0,<5.0.0
invenio-i18n>=3.0.0,<4.0.0
invenio-oauth2server>=3.0.0,<4.0.0
invenio-oauthclient>=6.0.0,<7.0.0
invenio-pidstore>=2.0.0,<3.0.0
invenio-records-rest>=3.0.0,<4.0.0
invenio-webhooks>=1.0.0,<2.0.0
invenio-records-resources>=8.0.0,<9.0.0
invenio-oauth2server>=4.0.0,<5.0.0
invenio-oauthclient>=7.0.0,<8.0.0
invenio-pidstore>=3.0.0,<4.0.0
invenio-records-rest>=4.0.0,<5.0.0
invenio-webhooks>=2.0.0,<3.0.0
invenio-records-resources>=9.0.0,<10.0.0
mistune>=0.7.2
six>=1.12.0
uritemplate>=3.0.1

[options.extras_require]
tests =
httpretty>=0.8.14
invenio-app>=2.0.0,<3.0.0
invenio-db[postgresql,mysql]>=2.0.0,<3.0.0
invenio-files-rest>=3.0.0,<4.0.0
invenio-app>=3.0.0,<4.0.0
invenio-db[postgresql,mysql]>=2.2.0,<3.0.0
invenio-files-rest>=4.0.0,<5.0.0
isort>=4.2.2
mock>=2.0.0
pytest-black-ng>=0.4.0
pytest-invenio>=3.0.0,<4.0.0
pytest-black>=0.6.0
pytest-invenio>=4.0.0,<5.0.0
pytest-mock>=2.0.0
sphinx>=4.5.0
elasticsearch7 =
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
# or submit itself to any jurisdiction.

"""Define fixtures for tests."""

import os
from base64 import b64encode
from zipfile import ZipFile
Expand Down
1 change: 1 addition & 0 deletions tests/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
# Invenio-Github is free software; you can redistribute it and/or modify
# it under the terms of the MIT License; see LICENSE file for more details.
"""Test invenio-github views."""

from flask_security import login_user
from invenio_accounts.testutils import login_user_via_session
from invenio_oauthclient.models import RemoteAccount
Expand Down
Loading