Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
8b66164
Devendorize: Replace DANDI specific identifier with more generic regexes
yarikoptic Apr 4, 2025
2388b15
Allow for vendorization of the "dandi:" namespace
yarikoptic Apr 22, 2025
697731a
Fix regex for DOI
yarikoptic Apr 25, 2025
704ba4a
feat: support vendorization through config
candleindark Apr 29, 2025
75f146f
test: update tests for changes in support of vendorization
candleindark May 13, 2025
266254c
rf: rename `test_dantimeta_1()` to `test_dandimeta_1()`
candleindark May 20, 2025
8c3a3e7
fix: add end of string anchor to `DANDI_DOI_PATTERN`
candleindark May 23, 2025
8ceed31
feat: define `PublishedDandiset.doi` on condition
candleindark May 25, 2025
2cd0116
test: adjust tests for conditional definition of `PublishedDandiset.doi`
candleindark May 27, 2025
1f9ab2f
test: provide DANDI and EMBER datacite login accordingly
candleindark May 28, 2025
9ee60bd
rf: set default shell to bash in `test.yml`
candleindark May 28, 2025
0129396
test: skip tests that depends on the setting of `DOI_PREFIX` conditio…
candleindark May 28, 2025
312d45d
fix: add end of string anchor to `DANDI_PUBID_PATTERN `
candleindark May 30, 2025
917da9d
test: update skip condition on datacite related tests
candleindark May 30, 2025
0a0d94d
test: remove datacite auth info requirement for `test_datacite_relate…
candleindark May 30, 2025
794d9eb
rf: define and use `skipif_no_doi_prefix` decorator
candleindark May 30, 2025
69a21f9
rf: rename support function for test
candleindark May 30, 2025
fe5aae1
test: condition some tests on existence of test metadata
candleindark May 30, 2025
27a5b8f
style: simplify string expression
candleindark Jun 2, 2025
ea54db7
test: vendorize CI environment for dandi-cli tests
candleindark Jun 2, 2025
01d86aa
rf: rename `conf.CONFIG` to `conf.INSTANCE_CONFIG`
candleindark Jun 3, 2025
b2cb8ad
feat: let `Config` have `doi_prefix` field instead of `datacite_doi_i…
candleindark Jun 9, 2025
98aee1d
feat: define mechanism to reset instance config
candleindark Jun 3, 2025
c9b53e6
feat: remove the importing of `dandischema.metadata` in `dandischema`
candleindark Jun 3, 2025
36c88be
feat: replace use of `conf.INSTANCE_CONFIG` with `get_instance_config()`
candleindark Jun 3, 2025
169449a
test: adjust `skipif_no_datacite_auth`
candleindark Jul 3, 2025
3b3ff10
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 3, 2025
a125b74
test: add test for `get_instance_config`
candleindark Jul 3, 2025
11cf3db
test: add tests for `set_instance_config`
candleindark Jul 4, 2025
d8fa7dd
Merge pull request #306 from dandi/devendorize-config-reset
yarikoptic Jul 7, 2025
f2ecf9d
feat: allow `Config` or `dict` as input to `set_instance_config()`
candleindark Jul 11, 2025
2b7d935
Merge branch 'master' into devendorize
candleindark Jul 14, 2025
13a919f
test: update testing of `set_instance_config`
candleindark Jul 14, 2025
3576941
test: update testing of `set_instance_config`
candleindark Jul 14, 2025
c7bb614
feat: remove `id_pattern` property from `dandischema.conf.Config`
candleindark Jul 24, 2025
e712e4d
feat: remove `doi_prefix_pattern` property from `dandischema.conf.Con…
candleindark Jul 24, 2025
276844b
test: delay import of `dandischema.conf` in `test_conf.py`
candleindark Jul 27, 2025
c5f6327
test: add `TestConfig`
candleindark Jul 28, 2025
cf0293e
feat: add `licenses` field to `dandischema.conf.Config`
candleindark Jul 26, 2025
13b5364
feat: make `dandischema.models.LicenseType` instance specific
candleindark Jul 26, 2025
94accb8
test: update `TestSetInstanceConfig`
candleindark Jul 27, 2025
5bcdb38
test: update `test_types()`
candleindark Jul 28, 2025
46fba4b
test: add tests for instantiating `dandischema.conf.Config` with valu…
candleindark Jul 28, 2025
f9bb9be
perf: simplify json file storing SPDX license IDs
candleindark Jul 30, 2025
06a3638
feat: provide script for constructing the SPDX license ID list
candleindark Jul 30, 2025
1813632
Merge branch 'master' into vendorize-licenses
candleindark Jul 30, 2025
c1e1f2b
doc: improve doc string for `dandischema.models.LicenseType`
candleindark Jul 30, 2025
04ac72a
Add timeout to GET request in SPDX License fetching helper script
candleindark Jul 31, 2025
739edda
style: replace `importlib.resources.abc.Traversable.joinpath` uses
candleindark Aug 4, 2025
99f7722
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 4, 2025
4d35d09
fix: avoid hardcoding package name in `importlib.resources.files()` use
candleindark Aug 4, 2025
03617c6
style: mark internal funcs in `conf.py` private
candleindark Aug 4, 2025
4519e35
Merge branch 'master' into devendorize
candleindark Aug 4, 2025
4483d56
rf: define default instance name in a const
candleindark Aug 4, 2025
e40c21d
rf: make unvendored ID pattern non-private
candleindark Aug 4, 2025
d94ada9
feat: relex pattern for prefix of identifier when appropriate
candleindark Aug 4, 2025
09b470b
test: update tests per relaxed ID pattern
candleindark Aug 4, 2025
3d57ce0
rf: remove private naming of unvendored DOI prefix pattern
candleindark Aug 5, 2025
1b95c84
feat: relax DOI pattern when DOI prefix is not provided in Config
candleindark Aug 5, 2025
1570932
test: update tests for relax DOI pattern when appropriate
candleindark Aug 5, 2025
72b5257
style: simplify regex expression
candleindark Aug 5, 2025
4f04034
Merge pull request #312 from dandi/vendorize-licenses
yarikoptic Aug 8, 2025
b78da9e
Merge pull request #317 from dandi/relax-on-default
yarikoptic Aug 8, 2025
838bcf6
feat: provide environment variable aliases for setting instance config
candleindark Aug 22, 2025
23b404d
test: update tests for `dandischema.conf.py`
candleindark Aug 24, 2025
964d540
Merge pull request #322 from dandi/env-var-alias
candleindark Aug 26, 2025
bbd9f3e
Merge branch 'master' into devendorize
candleindark Sep 2, 2025
24340c1
ci: remove `DANDI_INSTANCE_NAME` and `DANDI_DOI_PREFIX` in `Test agai…
candleindark Sep 4, 2025
ffe0640
feat: make DataCite metadata generation vendor dependent
yarikoptic Aug 22, 2025
a9e1293
feat: add `instance_identifier` field to `Config`
candleindark Aug 26, 2025
4c0ed42
feat: set default of instance identifier to `None`
candleindark Aug 28, 2025
9e9881a
chore: remove unused import of `requests`
candleindark Sep 2, 2025
e0478e2
test: update tests related to DateCite metadata generation
candleindark Sep 2, 2025
16bb639
test: update CI test workflow
candleindark Sep 4, 2025
b07e839
test: add test for `instance_identifier`
candleindark Sep 4, 2025
4efc64c
feat: condition the value of instance identifier
candleindark Sep 4, 2025
a2280e2
test: update tests for the introduction of instance identifier field
candleindark Sep 4, 2025
7ef784f
Merge pull request #323 from dandi/publisher-tuneup-in-datacite
candleindark Sep 5, 2025
0ecbfaa
feat: provide publisher identifier only when available in DataCite me…
candleindark Sep 6, 2025
8f1da33
feat: add `instance_url` field to `dandischema.conf.Config`
candleindark Sep 8, 2025
e9c2645
Merge pull request #328 from dandi/devendorize-instance-url
candleindark Sep 8, 2025
146bbd5
Merge branch 'master' into devendorize
candleindark Sep 9, 2025
414718b
Use generic programming check for having instance_identifier set
yarikoptic Sep 10, 2025
2cd1a45
Merge pull request #326 from dandi/handle-none-instance-identifier
candleindark Sep 10, 2025
efdbe88
Merge branch 'master' into devendorize
candleindark Sep 11, 2025
69a0e82
doc: add information to customize metadata models with vendor informa…
candleindark Sep 11, 2025
f9979a2
Merge pull request #330 from dandi/devendorize-readme
yarikoptic Sep 17, 2025
f1d9dc7
test: remove use of `unittest.mock.ANY`
candleindark Sep 18, 2025
fdddc69
Merge pull request #335 from dandi/fix-mypy-errs
yarikoptic Sep 18, 2025
6858916
feat: allow `Config` to be initialized with field names
candleindark Sep 22, 2025
22bf029
test: update tests so that field names are used to initialize Config
candleindark Sep 23, 2025
f32125a
test: add `"instance_url"` key to config dict for testing
candleindark Sep 23, 2025
715a383
test: test initializing `dandischema.conf.Config` kwargs
candleindark Sep 23, 2025
8fe9701
test: test init `dandischema.conf.Config` by field names through dote…
candleindark Sep 24, 2025
7eafc38
test: test round trip of `dandischema.conf.Config`
candleindark Sep 24, 2025
5406628
Merge pull request #336 from dandi/devendorize-init-config-with-field…
yarikoptic Sep 24, 2025
24f800e
Merge branch 'master' into devendorize
candleindark Oct 20, 2025
33ac781
Merge branch 'master' into devendorize
candleindark Oct 30, 2025
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
64 changes: 52 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,32 @@ on:
jobs:
test:
runs-on: ${{ matrix.os }}
env:
NO_ET: 1
DATACITE_DEV_PASSWORD: ${{ secrets.DATACITE_DEV_PASSWORD }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
os:
- windows-latest
- ubuntu-latest
- macos-latest
python:
- 3.9
- '3.10'
- '3.11'
- '3.12'
os: [windows-latest, ubuntu-latest, macos-latest]
python: ['3.9', '3.10', '3.11', '3.12']
vendored_env: [unvendored]
include:
- os: ubuntu-latest
python: '3.9'
vendored_env: dandi
instance_name: DANDI
instance_identifier: 'RRID:SCR_017571'
doi_prefix: '10.80507'
- os: ubuntu-latest
python: '3.9'
vendored_env: ember-dandi
instance_name: EMBER-DANDI
instance_identifier: 'RRID:SCR_026700'
doi_prefix: '10.82754'
- os: ubuntu-latest
python: '3.9'
vendored_env: ember-dandi-no-doi
instance_name: EMBER-DANDI
steps:
- name: Set up environment
uses: actions/checkout@v5
Expand All @@ -42,7 +53,36 @@ jobs:
python -m pip install --upgrade pip wheel
python -m pip install --upgrade tox

# Set only if matrix.instance_name is defined
- name: Set DANDI_INSTANCE_NAME
if: ${{ matrix.instance_name }}
run: echo "DANDI_INSTANCE_NAME=${{ matrix.instance_name }}" >> "$GITHUB_ENV"

# Set only if matrix.instance_identifier is defined
- name: Set DANDI_INSTANCE_IDENTIFIER
if: ${{ matrix.instance_identifier }}
run: echo "DANDI_INSTANCE_IDENTIFIER=${{ matrix.instance_identifier }}" >> "$GITHUB_ENV"

# Set only if matrix.doi_prefix is defined
- name: Set DANDI_DOI_PREFIX
if: ${{ matrix.doi_prefix }}
run: echo "DANDI_DOI_PREFIX=${{ matrix.doi_prefix }}" >> "$GITHUB_ENV"

- name: Set DANDI DataCite credentials
if: ${{ matrix.vendored_env == 'dandi' }}
run: |
echo "DATACITE_DEV_LOGIN=${{ secrets.DATACITE_DEV_DANDI_LOGIN }}" >> "$GITHUB_ENV"
echo "DATACITE_DEV_PASSWORD=${{ secrets.DATACITE_DEV_DANDI_PASSWORD }}" >> "$GITHUB_ENV"

- name: Set EMBER DataCite credentials
if: ${{ matrix.vendored_env == 'ember-dandi' }}
run: |
echo "DATACITE_DEV_LOGIN=${{ secrets.DATACITE_DEV_EMBER_LOGIN }}" >> "$GITHUB_ENV"
echo "DATACITE_DEV_PASSWORD=${{ secrets.DATACITE_DEV_EMBER_PASSWORD }}" >> "$GITHUB_ENV"

- name: Run all tests
env:
NO_ET: 1
run: tox -e py -- -s --cov-report=xml

- name: Upload coverage to Codecov
Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ Important files in this repository include:
- [metadata.py](./dandischema/metadata.py) - contains functions for validating, migrating, and aggregating metadata
- [datacite package](./dandischema/datacite) - contains functions for converting Dandiset metadata to DataCite metadata

## Customization with Vendor Information

The DANDI metadata models defined in this library can be customized with vendor-specific information.
The parameters of the customization are defined by the fields of the `Config` class in
[dandischema/conf.py](./dandischema/conf.py). The `Config` class is a subclass of
[`pydantic_settings.BaseSettings`](https://docs.pydantic.dev/latest/concepts/pydantic_settings/),
and the values of the fields in an instance of the `Config` class can be set through environment
variables and `.env` files, as documented in
[the Pydantic Settings documentation](https://docs.pydantic.dev/latest/concepts/pydantic_settings/).
Specifically,

- The value of a field is set from an environment variable with the same name, case-insensitively,
as one of the aliases of the field. For example, the `instance_name` field can be set from
the `DANDI_INSTANCE_NAME` or `DJANGO_DANDI_INSTANCE_NAME` environment variable.
- A value of a complex type (e.g., `list`, `set`, `dict`) should be expressed as a JSON-encoded string
in an environment variable. For example, the value for the `licenses` field, which is of
type `set`, can be set from the `DANDI_LICENSES` environment variable defined as the following:
```shell
export DANDI_LICENSES='["spdx:CC0-1.0", "spdx:CC-BY-4.0"]'
```

## Resources

* To learn how to interact with the DANDI archive,
Expand Down
3 changes: 1 addition & 2 deletions dandischema/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
__all__ = ["__version__", "migrate", "validate"]
__all__ = ["__version__"]

from ._version import __version__
from .metadata import migrate, validate
Loading
Loading