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

installation: unpin pycountry #279

Merged
merged 7 commits into from
Jul 17, 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
36 changes: 17 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,36 @@ on:
jobs:
Tests:
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.experimental }}
strategy:
matrix:
#python-version: [2.7, 3.6]
python-version: [2.7]
requirements-level: [min, pypi]
python-version: [3.9]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
python-version: [3.9]
python-version: [3.9,3.12]

requirements-level: [pypi]
experimental: [false]
include:
- python-version: 3.12
experimental: true
env:
DB: ${{ matrix.db-service }}
EXTRAS: tests

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Generate dependencies
run: |
python -m pip install --upgrade "pip>=20,<21" "setuptools>=40,<46" py
python -m pip install wheel coveralls requirements-builder configparser
requirements-builder --level=${{ matrix.requirements-level }} setup.py > .${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt

- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.${{ matrix.requirements-level }}-${{ matrix.python-version }}-requirements.txt') }}
cache: pip
cache-dependency-path: setup.cfg

- name: Install dependencies
run: |
pip install -r .${{matrix.requirements-level}}-${{ matrix.python-version }}-requirements.txt
pip install -e .[all]
pip install ".[$EXTRAS]"
pip freeze
docker --version
docker-compose --version

- name: Run tests
run: ./run-tests.sh
6 changes: 1 addition & 5 deletions cds_dojson/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,4 @@

"""The CDS DoJson."""

from .version import __version__

__all__ = (
'__version__',
)
__version__ = "0.11.0"
10 changes: 7 additions & 3 deletions cds_dojson/marc21/fields/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@

from __future__ import absolute_import, print_function

from dojson.utils import (IgnoreKey, filter_values, for_each_value, force_list,
ignore_value)
from dojson.utils import (
IgnoreKey,
filter_values,
for_each_value,
force_list,
ignore_value,
)

from ..models.base import model
from .utils import build_contributor, build_contributor_from_508


@model.over('recid', '^001')
Expand Down
35 changes: 25 additions & 10 deletions cds_dojson/marc21/fields/books/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,32 @@
from dojson.errors import IgnoreKey
from dojson.utils import filter_values, flatten, for_each_value, force_list

from cds_dojson.marc21.fields.books.errors import MissingRequiredField, \
UnexpectedValue
from cds_dojson.marc21.fields.books.errors import MissingRequiredField, UnexpectedValue
from cds_dojson.marc21.fields.books.utils import extract_volume_number
from cds_dojson.marc21.fields.books.values_mapping import ACQUISITION_METHOD, \
ARXIV_CATEGORIES, COLLECTION, DOCUMENT_TYPE, EXTERNAL_SYSTEM_IDENTIFIERS, \
EXTERNAL_SYSTEM_IDENTIFIERS_TO_IGNORE, MATERIALS, MEDIUM_TYPES, \
SUBJECT_CLASSIFICATION_EXCEPTIONS, mapping
from cds_dojson.marc21.fields.utils import ManualMigrationRequired, \
build_contributor_books, clean_email, clean_pages_range, clean_val, \
filter_list_values, get_week_start, out_strip, related_url, \
replace_in_result
from cds_dojson.marc21.fields.books.values_mapping import (
ACQUISITION_METHOD,
ARXIV_CATEGORIES,
COLLECTION,
DOCUMENT_TYPE,
EXTERNAL_SYSTEM_IDENTIFIERS,
EXTERNAL_SYSTEM_IDENTIFIERS_TO_IGNORE,
MATERIALS,
MEDIUM_TYPES,
SUBJECT_CLASSIFICATION_EXCEPTIONS,
mapping,
)
from cds_dojson.marc21.fields.utils import (
ManualMigrationRequired,
build_contributor_books,
clean_email,
clean_pages_range,
clean_val,
filter_list_values,
get_week_start,
out_strip,
related_url,
replace_in_result,
)
from cds_dojson.marc21.models.books.base import model

from .utils import extract_parts, is_excluded
Expand Down
17 changes: 11 additions & 6 deletions cds_dojson/marc21/fields/books/book.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@
from dojson.errors import IgnoreKey
from dojson.utils import filter_values, for_each_value

from cds_dojson.marc21.fields.books.errors import ManualMigrationRequired, \
MissingRequiredField, UnexpectedValue
from cds_dojson.marc21.fields.books.utils import extract_parts, \
extract_volume_number, is_excluded
from cds_dojson.marc21.fields.utils import clean_val, filter_list_values, \
out_strip
from cds_dojson.marc21.fields.books.errors import (
ManualMigrationRequired,
MissingRequiredField,
UnexpectedValue,
)
from cds_dojson.marc21.fields.books.utils import (
extract_parts,
extract_volume_number,
is_excluded,
)
from cds_dojson.marc21.fields.utils import clean_val, filter_list_values, out_strip
from cds_dojson.marc21.models.books.book import model

from .base import alternative_titles as alternative_titles_base
Expand Down
3 changes: 1 addition & 2 deletions cds_dojson/marc21/fields/books/journal.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@

from cds_dojson.marc21.fields.books.book import title as base_title
from cds_dojson.marc21.fields.books.errors import UnexpectedValue
from cds_dojson.marc21.fields.utils import clean_val, filter_list_values, \
out_strip
from cds_dojson.marc21.fields.utils import clean_val, filter_list_values, out_strip
from cds_dojson.marc21.models.books.journal import model


Expand Down
18 changes: 12 additions & 6 deletions cds_dojson/marc21/fields/books/multipart.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,18 @@
from dojson.errors import IgnoreKey
from dojson.utils import for_each_value, force_list

from cds_dojson.marc21.fields.books.errors import MissingRequiredField, \
UnexpectedValue
from cds_dojson.marc21.fields.books.utils import extract_parts, \
extract_volume_info, extract_volume_number
from cds_dojson.marc21.fields.utils import build_contributor_books, \
clean_val, filter_list_values, out_strip
from cds_dojson.marc21.fields.books.errors import MissingRequiredField, UnexpectedValue
from cds_dojson.marc21.fields.books.utils import (
extract_parts,
extract_volume_info,
extract_volume_number,
)
from cds_dojson.marc21.fields.utils import (
build_contributor_books,
clean_val,
filter_list_values,
out_strip,
)
from cds_dojson.marc21.models.books.multipart import model

from .base import alternative_identifiers as alternative_identifiers_base
Expand Down
6 changes: 2 additions & 4 deletions cds_dojson/marc21/fields/books/serial.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
"""Books fields."""
from dojson.utils import for_each_value

from cds_dojson.marc21.fields.books.multipart import \
isbns as multipart_identifiers
from cds_dojson.marc21.fields.utils import clean_val, filter_list_values, \
out_strip
from cds_dojson.marc21.fields.books.multipart import isbns as multipart_identifiers
from cds_dojson.marc21.fields.utils import clean_val, filter_list_values, out_strip
from cds_dojson.marc21.models.books.serial import model


Expand Down
3 changes: 1 addition & 2 deletions cds_dojson/marc21/fields/books/standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@

from cds_dojson.marc21.fields.books.errors import UnexpectedValue
from cds_dojson.marc21.fields.books.utils import extract_parts, is_excluded
from cds_dojson.marc21.fields.utils import clean_val, filter_list_values, \
out_strip
from cds_dojson.marc21.fields.utils import clean_val, filter_list_values, out_strip
from cds_dojson.marc21.models.books.standard import model


Expand Down
9 changes: 6 additions & 3 deletions cds_dojson/marc21/fields/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,11 @@
from dojson.utils import force_list
from six import PY2, iteritems

from cds_dojson.marc21.fields.books.errors import ManualMigrationRequired, \
MissingRequiredField, UnexpectedValue
from cds_dojson.marc21.fields.books.errors import (
ManualMigrationRequired,
MissingRequiredField,
UnexpectedValue,
)
from cds_dojson.utils import MementoDict


Expand Down Expand Up @@ -353,6 +356,7 @@ def _extract_json_ids(info, provenence='source'):
regex = re.compile(r'((AUTHOR\|\((CDS|INSPIRE)\))|(\(SzGeCERN\)))(.*)')
ids = []
author_ids = force_list(info.get('0', ''))

for author_id in author_ids:
match = regex.match(author_id)
if match:
Expand All @@ -374,7 +378,6 @@ def _extract_json_ids(info, provenence='source'):
ids.append({'value': info['inspireid'], provenence: 'INSPIRE ID'})
except KeyError:
pass

return ids


Expand Down
10 changes: 6 additions & 4 deletions cds_dojson/marc21/fields/videos/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
from __future__ import absolute_import, print_function

from dojson.errors import IgnoreKey
from dojson.utils import filter_values, for_each_value, force_list, \
ignore_value
from dojson.utils import filter_values, for_each_value, force_list, ignore_value

from ...fields.utils import build_contributor_from_508, \
build_contributor_videos, clean_val
from ...fields.utils import (
build_contributor_from_508,
build_contributor_videos,
clean_val,
)
from ...models.videos.base import model


Expand Down
3 changes: 1 addition & 2 deletions cds_dojson/marc21/fields/videos/video.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@

import arrow
from dojson.errors import IgnoreKey
from dojson.utils import filter_values, for_each_value, force_list, \
ignore_value
from dojson.utils import filter_values, for_each_value, force_list, ignore_value
from six import iteritems

from ...models.videos.video import model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@
"silent",
"sk",
"sl",
"sr",
"sv",
"tr",
"uk",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,6 @@
"silent",
"sk",
"sl",
"sr",
"sv",
"tr",
"uk",
Expand Down Expand Up @@ -590,7 +589,6 @@
"silent",
"sk",
"sl",
"sr",
"sv",
"tr",
"uk",
Expand Down
2 changes: 0 additions & 2 deletions cds_dojson/schemas/records/definitions-v1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,6 @@
"silent",
"sk",
"sl",
"sr",
"sr",
"sv",
"tr",
"uk",
Expand Down
13 changes: 9 additions & 4 deletions cds_dojson/schemas/records/videos/project/project-v1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,9 @@
"minItems": 1,
"items": {
"additionalProperties": false,
"required": ["name"],
"required": [
"name"
],
"type": "object",
"description": "An entity responsible for making contributions to the resource. Examples of a Contributor include a person, an organization, or a service. Typically, the name of a Contributor should be used to indicate the entity.",
"properties": {
Expand Down Expand Up @@ -167,7 +169,9 @@
},
"title": {
"additionalProperties": false,
"required": ["title"],
"required": [
"title"
],
"type": "object",
"description": "A name given to the resource. Typically, a Title will be a name by which the resource is formally known.",
"properties": {
Expand Down Expand Up @@ -320,7 +324,6 @@
"silent",
"sk",
"sl",
"sr",
"sv",
"tr",
"uk",
Expand All @@ -334,7 +337,9 @@
},
"title": {
"additionalProperties": false,
"required": ["title"],
"required": [
"title"
],
"type": "object",
"description": "A name given to the resource. Typically, a Title will be a name by which the resource is formally known.",
"properties": {
Expand Down
18 changes: 0 additions & 18 deletions cds_dojson/schemas/records/videos/video/video-v1.0.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -282,22 +282,6 @@
"type": "string",
"description": "Former BibDocFile.doctype."
},
"quality": {
"type": "string"
},
"content_type": {
"type": "string"
},
"context_type": {
"enum": [
"Master",
"Slave",
"Subtitle",
"Other"
],
"type": "string",
"description": "Former BibDocFile.doctype."
},
"quality": {
"type": "string"
},
Expand Down Expand Up @@ -450,7 +434,6 @@
"silent",
"sk",
"sl",
"sr",
"sv",
"tr",
"uk",
Expand Down Expand Up @@ -586,7 +569,6 @@
"silent",
"sk",
"sl",
"sr",
"sv",
"tr",
"uk",
Expand Down
Loading
Loading