diff --git a/.github/workflows/test-build.yml b/.github/workflows/test-build.yml index c6200373fe1..7fe875888d9 100644 --- a/.github/workflows/test-build.yml +++ b/.github/workflows/test-build.yml @@ -21,7 +21,7 @@ jobs: uses: actions/cache@v2 with: path: ~/.cache - key: reqs_${{ hashFiles('**/requirements.txt') }} + key: reqs_${{ hashFiles('**/pyproject.toml') }} restore-keys: reqs - run: | mkdir -p ~/.cache/downloads diff --git a/addons/bitbucket/requirements.txt b/addons/bitbucket/requirements.txt deleted file mode 100644 index e1eb62f260f..00000000000 --- a/addons/bitbucket/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -# no requirements diff --git a/addons/boa/requirements.txt b/addons/boa/requirements.txt deleted file mode 100644 index da5a1c65b02..00000000000 --- a/addons/boa/requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -# Requirements for the boa add-on -boa-api==0.1.14 - -# Requirements for running asyncio in celery, using 3.4.1 for Python 3.6 compatibility -asgiref==3.7.2 diff --git a/addons/box/requirements.txt b/addons/box/requirements.txt deleted file mode 100644 index c429a356fb2..00000000000 --- a/addons/box/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -boxsdk==3.9.2 diff --git a/addons/dataverse/requirements.txt b/addons/dataverse/requirements.txt deleted file mode 100644 index 13c09613bda..00000000000 --- a/addons/dataverse/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Allow for optional timeout parameter. -# https://github.com/IQSS/dataverse-client-python/pull/27 -git+https://github.com/CenterForOpenScience/dataverse-client-python.git@2b3827578048e6df3818f82381c7ea9a2395e526 # branch is feature/dv-client-updates diff --git a/addons/dropbox/requirements.txt b/addons/dropbox/requirements.txt deleted file mode 100644 index b6470418537..00000000000 --- a/addons/dropbox/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -dropbox==11.36.2 diff --git a/addons/figshare/requirements.txt b/addons/figshare/requirements.txt deleted file mode 100644 index 8b137891791..00000000000 --- a/addons/figshare/requirements.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/addons/github/requirements.txt b/addons/github/requirements.txt deleted file mode 100644 index f7c57e651e9..00000000000 --- a/addons/github/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -cachecontrol==0.14.0 -github3.py==4.0.1 -uritemplate==4.1.1 diff --git a/addons/gitlab/requirements.txt b/addons/gitlab/requirements.txt deleted file mode 100644 index 2edb928a210..00000000000 --- a/addons/gitlab/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -python-gitlab==4.4.0 diff --git a/addons/mendeley/requirements.txt b/addons/mendeley/requirements.txt deleted file mode 100644 index 094445ba370..00000000000 --- a/addons/mendeley/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -# up-to-date with mendeley's master + add folder support and future dep updates -git+https://github.com/CenterForOpenScience/mendeley-python-sdk.git@be8a811fa6c3b105d9f5c656cabb6b1ba855ed5b # branch is feature/osf-dep-updates diff --git a/addons/onedrive/requirements.txt b/addons/onedrive/requirements.txt deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/addons/owncloud/requirements.txt b/addons/owncloud/requirements.txt deleted file mode 100644 index 91497da541b..00000000000 --- a/addons/owncloud/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -# Requirements for the owncloud add-on -pyocclient==0.6.0 diff --git a/addons/s3/requirements.txt b/addons/s3/requirements.txt deleted file mode 100644 index 79406d53dd1..00000000000 --- a/addons/s3/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -boto3==1.34.60 diff --git a/addons/twofactor/requirements.txt b/addons/twofactor/requirements.txt deleted file mode 100644 index f0df16c6611..00000000000 --- a/addons/twofactor/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pyotp==2.9.0 \ No newline at end of file diff --git a/addons/wiki/requirements.txt b/addons/wiki/requirements.txt deleted file mode 100644 index aefa4d0d357..00000000000 --- a/addons/wiki/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pymongo==4.6.3 diff --git a/addons/zotero/requirements.txt b/addons/zotero/requirements.txt deleted file mode 100644 index 57f831d845f..00000000000 --- a/addons/zotero/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -Pyzotero==1.5.18 diff --git a/api/base/utils.py b/api/base/utils.py index fa1c66e7250..9e0dcbc7e8c 100644 --- a/api/base/utils.py +++ b/api/base/utils.py @@ -1,5 +1,5 @@ from furl import furl -from urllib.parse import urlunsplit, urlsplit, parse_qs, urlencode, quote +from urllib.parse import urlunsplit, urlsplit, parse_qs, urlencode from packaging.version import Version from hashids import Hashids @@ -236,7 +236,7 @@ def waterbutler_api_url_for(node_id, provider, path='/', _internal=False, base_u # NOTE: furl encoding to be verified later url = furl(website_settings.WATERBUTLER_INTERNAL_URL if _internal else (base_url or website_settings.WATERBUTLER_URL)) segments = ['v1', 'resources', node_id, 'providers', provider] + path.split('/')[1:] - url.add(path=[quote(x) for x in segments]) + url.add(path=segments) url.args.update(kwargs) return url.url diff --git a/api_tests/nodes/views/test_node_draft_registration_list.py b/api_tests/nodes/views/test_node_draft_registration_list.py index 7668e5e9516..5e46b46b4c0 100644 --- a/api_tests/nodes/views/test_node_draft_registration_list.py +++ b/api_tests/nodes/views/test_node_draft_registration_list.py @@ -342,7 +342,7 @@ def test_type_is_draft_registrations(self, app, user, metaschema_open_ended, url assert res.status_code == 409 def test_admin_can_create_draft( - self, app, user, project_public, url_draft_registrations, payload, metaschema_open_ended + self, app, user, project_public, url_draft_registrations, payload, metaschema_open_ended ): res = app.post_json_api( f'{url_draft_registrations}&embed=branched_from&embed=initiator', diff --git a/api_tests/users/views/test_user_draft_registration_list.py b/api_tests/users/views/test_user_draft_registration_list.py index a002ffe9a7e..1f43cc3ee33 100644 --- a/api_tests/users/views/test_user_draft_registration_list.py +++ b/api_tests/users/views/test_user_draft_registration_list.py @@ -142,7 +142,7 @@ def test_cannot_access_other_users_draft_registration(self, app, user, other_adm assert res.status_code == 403 def test_can_access_own_draft_registrations_with_guid(self, app, user, draft_registration): - url = '/{}users/{}/draft_registrations/'.format(API_BASE, user._id) + url = f'/{API_BASE}users/{user._id}/draft_registrations/' res = app.get(url, auth=user.auth, expect_errors=True) assert res.status_code == 200 assert len(res.json['data']) == 1 diff --git a/docker-compose.yml b/docker-compose.yml index 22d0dad7676..ce4e3ea0618 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -358,7 +358,7 @@ services: - /bin/bash - -c - python -m venv /tmp/venv - && /tmp/venv/bin/pip install poetry==1.8.0 && + && /tmp/venv/bin/pip install poetry==1.8.3 && /tmp/venv/bin/poetry install --no-root --without release --compile --sync && rm -rf /python3.12/* && cp -Rf -p /usr/local/lib/python3.12 / @@ -366,7 +366,8 @@ services: environment: DJANGO_SETTINGS_MODULE: api.base.settings volumes: - - ./:/code:cached + - ./pyproject.toml:/code/pyproject.toml + - ./poetry.lock:/code/poetry.lock - osf_requirements_3_12_vol:/python3.12 assets: diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 7fb762e01b0..00000000000 --- a/requirements.txt +++ /dev/null @@ -1,107 +0,0 @@ -# Base requirements for running the OSF. -# NOTE: This does not include addon, development or release requirements. -# NOTE: When updating pinned version, you may also need to update constraints.txt -# To install addon requirements: inv requirements --addons -# To install dev requirements: inv requirements --dev -# To install release requirements: inv requirements --release -wheel==0.42.0 -invoke==2.2.0 -Werkzeug==3.0.1 -Flask==3.0.2 -Mako==1.3.2 -Markdown==3.5.2 -WTForms==3.1.2 -celery==5.3.6 -kombu==5.3.5 -itsdangerous==2.1.2 -lxml==5.1.0 -mailchimp3==3.0.21 -nameparser==1.1.3 -bcrypt==4.1.2 -python-dateutil==2.9.0 -pytz==2024.1 -bleach==6.1.0 -bleach[css]==6.1.0 -pillow==10.2.0 -Markupsafe==2.1.5 -blinker==1.7.0 -furl==2.1.3 -elasticsearch2==2.5.1 -elasticsearch==6.8.2 # max version to support elasticsearch6 -elasticsearch-dsl==6.4.0 # max version to support elasticsearch6 -elastic-transport==8.13.0 -google-api-python-client==2.123.0 -google-auth==2.29.0 -Babel==2.14.0 -citeproc-py==0.6.0 -boto3==1.34.60 -django-waffle==4.1.0 -pymongo[ocsp]==3.13.0 # install to get bson module -PyYAML==6.0.1 -tqdm==4.66.2 -email-validator==2.1.1 -# Python markdown extensions for comment emails -markdown-del-ins==1.0.0 - -certifi==2024.2.2 -sendgrid==6.11.0 - -requests==2.31.0 -urllib3==1.26.18 # still <2.0 because elasticseach2 lib doesn't supprort urllib3>=2.0 -oauthlib==3.2.2 -requests-oauthlib==1.3.1 -sentry-sdk[django, flask, celery]==2.2.0 -django-redis==5.4.0 - -# API requirements -Django==4.2.13 -djangorestframework==3.15.1 -django-cors-headers==4.3.1 -djangorestframework-bulk==0.2.1 -django-bulk-update==2.2.0 -hashids==1.3.1 -pyjwt==2.8.0 -django-celery-beat==2.6.0 -django-celery-results==2.5.1 -pyjwe==1.0.0 -# Required by pyjwe and ndg-httpsclient -cryptography==42.0.5 -#rpds-py==0.18.0 -jsonschema==4.21.1 - -django-guardian==2.4.0 - -# Admin requirements -# django-webpack-loader==3.1.0 -git+https://github.com/CenterForOpenScience/django-webpack-loader.git@af8438c2da909ec9f2188a6c07c9d2caad0f7e93 # branch is feature/v1-webpack-stats -django-sendgrid-v5==1.2.3 # metadata says python 3.10 not supported, but tests pass - -# Analytics requirements -keen==0.7.0 -geoip2==4.7.0 - -# OSF models -django-typed-models==0.14.0 -django-storages==1.14.3 -google-cloud-storage==2.16.0 # dependency of django-storages, hard-pin to version -django-dirtyfields==1.9.2 -django-extensions==3.2.3 -psycopg2==2.9.9 --no-binary psycopg2 -packaging==24.0 -# Reviews requirements -transitions==0.8.11 - -# identifiers -datacite==1.1.3 - -# metadata -rdflib==7.0.0 -packaging==24.0 - -colorlog==6.8.2 -# Metrics -git+https://github.com/CenterForOpenScience/django-elasticsearch-metrics.git@f5b9312914154e213aa01731e934c593e3434269 # branch is feature/pin-esdsl - -# Impact Metrics CSV Export -djangorestframework-csv==3.0.2 -gevent==24.2.1 diff --git a/requirements/dev.txt b/requirements/dev.txt deleted file mode 100644 index dafea0f22ac..00000000000 --- a/requirements/dev.txt +++ /dev/null @@ -1,38 +0,0 @@ --r ../requirements.txt - -# Requirements that are used in the development environment only - -# Testing -pytest==7.4.4 -pytest-socket==0.7.0 -pytest-xdist==3.5.0 -pytest-django==4.8.0 -python-coveralls==2.9.3 # do we need it? -pytest-testmon==2.1.0 -pytest-asyncio==0.23.5 -pytest-html==4.1.1 -factory-boy==3.3.0 -webtest-plus==1.0.0 -Faker==23.2.1 -schema==0.7.4 -responses==0.25.0 - -# Syntax checking -flake8==7.0.0 -flake8-mutable==1.2.0 -pre-commit==3.7.1 - -# Django Debug Toolbar for local development -django-debug-toolbar==4.3.0 - -# Ipdb -ipdb==0.13.13 - -# PyDevD (Remote Debugging) -pydevd==3.0.3 - -# n+1 query detection -nplusone==1.0.0 - -# Profiling -django-silk==5.1.0 diff --git a/requirements/release.txt b/requirements/release.txt deleted file mode 100644 index e9a4b575f73..00000000000 --- a/requirements/release.txt +++ /dev/null @@ -1,8 +0,0 @@ --r ../requirements.txt - -# Requirements to be installed on server deployments - -# newrelic APM agent -newrelic==9.7.1 -# uwsgi -uwsgi==2.0.24