Skip to content

Commit aaa533c

Browse files
committed
Merge main and fix conflicts
Signed-off-by: tdruez <tdruez@nexb.com>
2 parents 49f211f + 4fa1288 commit aaa533c

227 files changed

Lines changed: 1114 additions & 981 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/create-github-release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ jobs:
1616
with:
1717
generate_release_notes: true
1818
draft: false
19+
files: dist/*

.github/workflows/run-unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Set up Python
4040
uses: actions/setup-python@v5
4141
with:
42-
python-version: "3.12"
42+
python-version: "3.13"
4343

4444
- name: Install python-ldap OS dependencies
4545
run: |

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ version: 2
88
build:
99
os: ubuntu-22.04
1010
tools:
11-
python: "3.12"
11+
python: "3.13"
1212

1313
# Optionally declare the Python requirements required to build your docs
1414
python:

CHANGELOG.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
Release notes
22
=============
33

4+
### Version 5.3.1-dev (unreleased)
5+
6+
- Upgrade Python version to 3.13 and Django to 5.2.x
7+
https://github.com/aboutcode-org/dejacode/pull/315
8+
https://github.com/aboutcode-org/dejacode/pull/312
9+
10+
- Add new `is_locked` "Locked inventory" field to the ProductStatus model.
11+
When a Product is locked through his status, its inventory cannot be modified.
12+
https://github.com/aboutcode-org/dejacode/issues/189
13+
414
### Version 5.3.0
515

616
- Rename ProductDependency is_resolved to is_pinned.

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# See https://aboutcode.org for more information about AboutCode FOSS projects.
77
#
88

9-
FROM python:3.12-slim
9+
FROM python:3.13-slim
1010

1111
LABEL org.opencontainers.image.source="https://github.com/aboutcode-org/dejacode"
1212
LABEL org.opencontainers.image.description="DejaCode"

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# See https://aboutcode.org for more information about AboutCode FOSS projects.
77
#
88

9-
PYTHON_EXE=python3.12
9+
PYTHON_EXE=python3.13
1010
VENV_LOCATION=.venv
1111
ACTIVATE?=. ${VENV_LOCATION}/bin/activate;
1212
MANAGE=${VENV_LOCATION}/bin/python manage.py
@@ -136,7 +136,7 @@ postgresdb_clean:
136136
@${SUDO_POSTGRES} dropuser '${DB_USERNAME}' || true
137137

138138
run:
139-
${MANAGE} runserver 8000 --insecure
139+
DJANGO_RUNSERVER_HIDE_WARNING=true ${MANAGE} runserver 8000 --insecure
140140

141141
worker:
142142
${MANAGE} rqworker

component_catalog/api.py

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@
1111
from django.db import transaction
1212
from django.forms.widgets import HiddenInput
1313

14-
import coreapi
15-
import coreschema
1614
import django_filters
1715
from packageurl.contrib import url2purl
1816
from packageurl.contrib.django.filters import PackageURLFilter
1917
from rest_framework import serializers
2018
from rest_framework.decorators import action
2119
from rest_framework.fields import ListField
2220
from rest_framework.response import Response
23-
from rest_framework.schemas import AutoSchema
2421

2522
from component_catalog.admin import ComponentAdmin
2623
from component_catalog.admin import PackageAdmin
@@ -967,24 +964,7 @@ def download_scan_data(self, request, uuid):
967964
content_type="application/zip",
968965
)
969966

970-
download_url_description = (
971-
"A single, or list of, Download URL(s).<br><br>"
972-
'<b>cURL style</b>: <code>-d "download_url=url1&download_url=url2"</code><br><br>'
973-
'<b>Python</b>: <code>data = {"download_url": ["url1", "url2"]}</code>'
974-
)
975-
976-
add_action_schema = AutoSchema(
977-
manual_fields=[
978-
coreapi.Field(
979-
"download_url",
980-
required=True,
981-
location="body",
982-
schema=coreschema.String(description=download_url_description),
983-
),
984-
]
985-
)
986-
987-
@action(detail=False, methods=["post"], name="Package Add", schema=add_action_schema)
967+
@action(detail=False, methods=["post"], name="Package Add")
988968
def add(self, request):
989969
"""
990970
Alternative way to add a package providing only its `download_url`.

component_catalog/forms.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -624,8 +624,11 @@ def __init__(self, user, *args, **kwargs):
624624
super().__init__(user, *args, **kwargs)
625625

626626
product_field = self.fields["product"]
627-
perms = ["view_product", "change_product"]
628-
product_field.queryset = Product.objects.get_queryset(user, perms=perms)
627+
product_field.queryset = Product.objects.get_queryset(
628+
user=user,
629+
perms=["view_product", "change_product"],
630+
exclude_locked=True,
631+
)
629632

630633
if relation_instance:
631634
help_text = f'"{relation_instance}" will be assigned to the selected product.'
@@ -709,7 +712,9 @@ def __init__(self, request, model, relation_model, *args, **kwargs):
709712
self.relation_model = relation_model
710713
self.dataspace = request.user.dataspace
711714
self.fields["product"].queryset = Product.objects.get_queryset(
712-
request.user, perms=["view_product", "change_product"]
715+
user=request.user,
716+
perms=["view_product", "change_product"],
717+
exclude_locked=True,
713718
)
714719

715720
def get_selected_objects(self):

component_catalog/tests/test_admin.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,10 @@ def test_component_admin_form_clean(self):
230230
del data["name"]
231231
response = self.client.post(url, data)
232232
self.assertContains(response, '<p class="errornote">Please correct the error below.</p>')
233-
self.assertContains(response, '<ul class="errorlist"><li>This field is required.</li>')
233+
self.assertContains(
234+
response,
235+
'<ul class="errorlist" id="id_name_error"><li>This field is required.</li></ul>',
236+
)
234237

235238
@override_settings(REFERENCE_DATASPACE="Dataspace")
236239
def test_component_admin_form_clean_validate_against_reference_data(self):

dejacode/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
import git
1616

17-
VERSION = "5.3.0"
17+
VERSION = "5.3.1-dev"
1818

1919
PROJECT_DIR = Path(__file__).resolve().parent
2020
ROOT_DIR = PROJECT_DIR.parent

0 commit comments

Comments
 (0)