Skip to content

Commit

Permalink
Merge pull request #676 from dandi/api-02
Browse files Browse the repository at this point in the history
Python API rewrite, part 2
  • Loading branch information
yarikoptic authored Jul 23, 2021
2 parents f3c00c7 + b62b3b7 commit 2d07802
Show file tree
Hide file tree
Showing 14 changed files with 505 additions and 82 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
NO_ET: 1
DATACITE_DEV_PASSWORD: ${{ secrets.DATACITE_DEV_PASSWORD }}
DANDI_ALLOW_LOCALHOST_URLS: 1

strategy:
fail-fast: false
Expand Down
13 changes: 8 additions & 5 deletions dandi/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,9 @@

dandiset_metadata_file = "dandiset.yaml"
dandiset_identifier_regex = "^[0-9]{6}$"
VERSION_REGEX = r"(?:[.0-9]{5,}|draft)"

dandi_instance = namedtuple("dandi_instance", ("gui", "redirector", "api"))
DandiInstance = namedtuple("DandiInstance", ("gui", "redirector", "api"))

# So it could be easily mapped to external IP (e.g. from within VM)
# to test against instance running outside of current environment
Expand All @@ -76,22 +77,22 @@
redirector_base = os.environ.get("DANDI_REDIRECTOR_BASE", "https://dandiarchive.org")

known_instances = {
"dandi": dandi_instance(
"dandi": DandiInstance(
"https://gui.dandiarchive.org",
redirector_base,
"https://api.dandiarchive.org/api",
),
"dandi-devel": dandi_instance(
"dandi-devel": DandiInstance(
"https://gui-beta-dandiarchive-org.netlify.app",
None,
None,
),
"dandi-staging": dandi_instance(
"dandi-staging": DandiInstance(
"https://gui-staging.dandiarchive.org",
None,
"https://api-staging.dandiarchive.org/api",
),
"dandi-api-local-docker-tests": dandi_instance(
"dandi-api-local-docker-tests": DandiInstance(
None, None, f"http://{instancehost}:8000/api"
),
}
Expand All @@ -115,3 +116,5 @@
# TODO: should we make them smaller for download than for upload?
# ATM used only in download
MAX_CHUNK_SIZE = int(os.environ.get("DANDI_MAX_CHUNK_SIZE", 1024 * 1024 * 8)) # 64

DRAFT = "draft"
Loading

0 comments on commit 2d07802

Please sign in to comment.