diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d042e004..4e12532d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -41,8 +41,6 @@ jobs: with: upload_to_pypi: false upload_to_anaconda: false - test_extras: test - test_command: pytest --pyargs asdf_standard asdf-dev: name: Run asdf-development tests diff --git a/CHANGES.rst b/CHANGES.rst index f1eecb02..beff5a7c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -9,7 +9,6 @@ The stable ASDF Standard is v1.5.0 - Bugfix for ``base_format`` in ``time-1.2.0`` schema. [#349] - Add new ``ndarray-1.1.0`` schema to fix #345 [#350] - Remove ``unit-1.1.0`` erroneously added in #350 [#355] -- Refactor file layout [#360] - Fix URI fragment format in metaschema references. [#373] - Fix URI fragment format in quantity-1.2 schema [#374] - Drop support for python 3.8 [#390] diff --git a/docs/source/conf.py b/docs/source/conf.py index 92328a99..f12d9f57 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -238,7 +238,7 @@ # -- sphinx_asdf configuration --------------------------------------------- # Top-level directory containing ASDF schemas (relative to current directory) -asdf_schema_path = "../../src/asdf_standard/resources/schemas" +asdf_schema_path = "../../resources/schemas" # This is the prefix common to all schema IDs in this repository asdf_schema_standard_prefix = "stsci.edu/asdf" # This seems pretty redundant/unnecessary and should probably be fixed in the diff --git a/docs/source/schemas/manifest.rst b/docs/source/schemas/manifest.rst index d759c6c8..717b2d59 100644 --- a/docs/source/schemas/manifest.rst +++ b/docs/source/schemas/manifest.rst @@ -6,7 +6,7 @@ The ASDF tags (described by schemas) available under each ASDF standard version by a single manifest document for that ASDF standard version. .. asdf-autoschemas:: - :schema_root: ../../src/asdf_standard/resources/manifests + :schema_root: ../../resources/manifests :standard_prefix: asdf-format.org/core core-1.0.0 diff --git a/docs/source/schemas/yaml_schema.rst b/docs/source/schemas/yaml_schema.rst index 3b3a2b62..6c836e84 100644 --- a/docs/source/schemas/yaml_schema.rst +++ b/docs/source/schemas/yaml_schema.rst @@ -26,7 +26,7 @@ Writing a new schema is described in :ref:`extending-asdf`. .. _yaml-schema-draft-01: .. asdf-schema:: - :schema_root: ../../src/asdf_standard/resources/schemas/stsci.edu + :schema_root: ../../resources/schemas/stsci.edu :standard_prefix: yaml-schema/draft-01 diff --git a/pyproject.toml b/pyproject.toml index 16eae595..8fee45c5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,14 +61,14 @@ write_to = "src/asdf_standard/_version.py" packages = ["asdf_standard", "asdf_standard.resources"] [tool.setuptools.package-data] -"asdf_standard.resources" = ["src/asdf_standard/resources/**/*.yaml"] +"asdf_standard.resources" = ["resources/**/*.yaml"] [tool.setuptools.package-dir] "" = "src" -"asdf_standard.resources" = "src/asdf_standard/resources" +"asdf_standard.resources" = "resources" [tool.pytest.ini_options] -asdf_schema_root = 'src/asdf_standard/resources/schemas' +asdf_schema_root = 'resources/schemas' asdf_schema_skip_tests = """ stsci.edu/asdf/asdf-schema-1.0.0.yaml stsci.edu/asdf/wcs/celestial_frame-1.0.0.yaml diff --git a/src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.0.0.yaml b/resources/manifests/asdf-format.org/core/core-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.0.0.yaml rename to resources/manifests/asdf-format.org/core/core-1.0.0.yaml diff --git a/src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.1.0.yaml b/resources/manifests/asdf-format.org/core/core-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.1.0.yaml rename to resources/manifests/asdf-format.org/core/core-1.1.0.yaml diff --git a/src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.2.0.yaml b/resources/manifests/asdf-format.org/core/core-1.2.0.yaml similarity index 100% rename from src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.2.0.yaml rename to resources/manifests/asdf-format.org/core/core-1.2.0.yaml diff --git a/src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.3.0.yaml b/resources/manifests/asdf-format.org/core/core-1.3.0.yaml similarity index 100% rename from src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.3.0.yaml rename to resources/manifests/asdf-format.org/core/core-1.3.0.yaml diff --git a/src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.4.0.yaml b/resources/manifests/asdf-format.org/core/core-1.4.0.yaml similarity index 100% rename from src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.4.0.yaml rename to resources/manifests/asdf-format.org/core/core-1.4.0.yaml diff --git a/src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.5.0.yaml b/resources/manifests/asdf-format.org/core/core-1.5.0.yaml similarity index 100% rename from src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.5.0.yaml rename to resources/manifests/asdf-format.org/core/core-1.5.0.yaml diff --git a/src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.6.0.yaml b/resources/manifests/asdf-format.org/core/core-1.6.0.yaml similarity index 100% rename from src/asdf_standard/resources/manifests/asdf-format.org/core/core-1.6.0.yaml rename to resources/manifests/asdf-format.org/core/core-1.6.0.yaml diff --git a/src/asdf_standard/resources/schemas/asdf-format.org/core/extension_manifest-1.0.0.yaml b/resources/schemas/asdf-format.org/core/extension_manifest-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/asdf-format.org/core/extension_manifest-1.0.0.yaml rename to resources/schemas/asdf-format.org/core/extension_manifest-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/asdf-schema-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/asdf-schema-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/asdf-schema-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/asdf-schema-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/asdf-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/asdf-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/asdf-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/asdf-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/asdf-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/core/asdf-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/asdf-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/core/asdf-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/column-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/column-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/column-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/column-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/column-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/core/column-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/column-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/core/column-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/complex-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/complex-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/complex-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/complex-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/constant-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/constant-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/constant-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/constant-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/extension_metadata-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/extension_metadata-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/extension_metadata-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/extension_metadata-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/externalarray-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/externalarray-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/externalarray-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/externalarray-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/history_entry-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/history_entry-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/history_entry-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/history_entry-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/integer-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/integer-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/integer-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/integer-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/integer-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/core/integer-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/integer-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/core/integer-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/ndarray-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/ndarray-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/ndarray-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/ndarray-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/core/ndarray-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/software-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/software-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/software-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/software-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/subclass_metadata-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/subclass_metadata-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/subclass_metadata-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/subclass_metadata-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/table-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/core/table-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/table-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/core/table-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/core/table-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/core/table-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/core/table-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/core/table-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/fits/fits-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/fits/fits-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/fits/fits-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/fits/fits-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/fits/fits-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/fits/fits-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/fits/fits-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/fits/fits-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/time/time-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/time/time-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/time/time-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/time/time-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/time/time-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/time/time-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/time/time-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/time/time-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/time/time-1.2.0.yaml b/resources/schemas/stsci.edu/asdf/time/time-1.2.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/time/time-1.2.0.yaml rename to resources/schemas/stsci.edu/asdf/time/time-1.2.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/unit/defunit-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/unit/defunit-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/unit/defunit-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/unit/defunit-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/unit/quantity-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/unit/quantity-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/unit/quantity-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/unit/quantity-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/unit/quantity-1.2.0.yaml b/resources/schemas/stsci.edu/asdf/unit/quantity-1.2.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/unit/quantity-1.2.0.yaml rename to resources/schemas/stsci.edu/asdf/unit/quantity-1.2.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/unit/unit-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/unit/unit-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/unit/unit-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/unit/unit-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/version_map-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/version_map-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/version_map-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/version_map-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.2.0.yaml b/resources/schemas/stsci.edu/asdf/version_map-1.2.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.2.0.yaml rename to resources/schemas/stsci.edu/asdf/version_map-1.2.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.3.0.yaml b/resources/schemas/stsci.edu/asdf/version_map-1.3.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.3.0.yaml rename to resources/schemas/stsci.edu/asdf/version_map-1.3.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.4.0.yaml b/resources/schemas/stsci.edu/asdf/version_map-1.4.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.4.0.yaml rename to resources/schemas/stsci.edu/asdf/version_map-1.4.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.5.0.yaml b/resources/schemas/stsci.edu/asdf/version_map-1.5.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.5.0.yaml rename to resources/schemas/stsci.edu/asdf/version_map-1.5.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.6.0.yaml b/resources/schemas/stsci.edu/asdf/version_map-1.6.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/version_map-1.6.0.yaml rename to resources/schemas/stsci.edu/asdf/version_map-1.6.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/celestial_frame-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/celestial_frame-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/celestial_frame-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/celestial_frame-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/celestial_frame-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/celestial_frame-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/celestial_frame-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/celestial_frame-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/composite_frame-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/composite_frame-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/composite_frame-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/composite_frame-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/composite_frame-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/composite_frame-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/composite_frame-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/composite_frame-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/frame-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/frame-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/frame-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/frame-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/frame-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/frame-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/frame-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/frame-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/icrs_coord-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/icrs_coord-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/icrs_coord-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/icrs_coord-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/spectral_frame-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/spectral_frame-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/spectral_frame-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/spectral_frame-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/spectral_frame-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/spectral_frame-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/spectral_frame-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/spectral_frame-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/step-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/step-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/step-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/step-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/step-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/step-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/step-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/step-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/step-1.2.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/step-1.2.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/step-1.2.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/step-1.2.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/wcs-1.0.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/wcs-1.0.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/wcs-1.0.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/wcs-1.0.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/wcs-1.1.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/wcs-1.1.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/wcs-1.1.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/wcs-1.1.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/wcs-1.2.0.yaml b/resources/schemas/stsci.edu/asdf/wcs/wcs-1.2.0.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/asdf/wcs/wcs-1.2.0.yaml rename to resources/schemas/stsci.edu/asdf/wcs/wcs-1.2.0.yaml diff --git a/src/asdf_standard/resources/schemas/stsci.edu/yaml-schema/draft-01.yaml b/resources/schemas/stsci.edu/yaml-schema/draft-01.yaml similarity index 100% rename from src/asdf_standard/resources/schemas/stsci.edu/yaml-schema/draft-01.yaml rename to resources/schemas/stsci.edu/yaml-schema/draft-01.yaml diff --git a/src/asdf_standard/integration.py b/src/asdf_standard/integration.py index 4ab83523..8981fe56 100644 --- a/src/asdf_standard/integration.py +++ b/src/asdf_standard/integration.py @@ -1,4 +1,5 @@ import sys +from pathlib import Path if sys.version_info < (3, 9): import importlib_resources @@ -11,7 +12,11 @@ def get_resource_mappings(): resources_root = importlib_resources.files(asdf_standard) / "resources" if not resources_root.is_dir(): - raise RuntimeError("Missing resources directory") + # In an editable install, the resources directory will exist off the + # repository root: + resources_root = Path(__file__).absolute().parent.parent.parent / "resources" + if not resources_root.is_dir(): + raise RuntimeError("Missing resources directory") return [ asdf_standard.DirectoryResourceMapping( diff --git a/src/asdf_standard/tests/common.py b/src/asdf_standard/tests/common.py deleted file mode 100644 index bf8ce83e..00000000 --- a/src/asdf_standard/tests/common.py +++ /dev/null @@ -1,170 +0,0 @@ -import re -from pathlib import Path -from urllib.parse import urljoin - -import yaml -from packaging.version import Version - -ROOT_PATH = Path(__file__).parent.parent - -RESOURCES_PATH = ROOT_PATH / "resources" - -SCHEMAS_PATH = RESOURCES_PATH / "schemas" / "stsci.edu" / "asdf" -YAML_SCHEMA_PATH = RESOURCES_PATH / "schemas" / "stsci.edu" / "yaml-schema" - -MANIFESTS_PATH = RESOURCES_PATH / "manifests" / "asdf-format.org" / "core" - -VERSION_MAP_PATHS = list(SCHEMAS_PATH.glob("version_map-*.yaml")) - -VALID_YAML_VERSIONS = {"1.1"} -VALID_FILE_FORMAT_VERSIONS = {"1.0.0"} - -VALID_SCHEMA_FILENAME_RE = re.compile(r"[a-z0-9_]+-[0-9]+\.[0-9]+\.[0-9]+\.yaml") - -DEPRECATED_PATTERNS = {re.compile(".*/transform/.*"), re.compile(".*/wcs/.*")} - -METASCHEMA_ID = "http://stsci.edu/schemas/yaml-schema/draft-01" - -YAML_TAG_RE = re.compile(r"![a-z/0-9_-]+-[0-9]+\.[0-9]+\.[0-9]") - -DESCRIPTION_REF_RE = re.compile(r"\(ref:(.*?)\)") - - -def get_schema_ids(schemas): - result = set() - for schema in schemas: - if "id" in schema: - result.add(schema["id"]) - return result - - -def get_tag(schema): - if "tag" in schema: - return schema["tag"] - elif "anyOf" in schema: - for elem in schema["anyOf"]: - if "tag" in elem: - return elem["tag"] - return None - - -def load_yaml(path): - with path.open() as f: - return yaml.safe_load(f.read()) - - -def assert_yaml_header_and_footer(path): - with path.open() as f: - content = f.read() - - assert any( - content.startswith(f"%YAML {v}\n---\n") for v in VALID_YAML_VERSIONS - ), f"{path.name} must start with a %YAML directive with a supported version" - - assert content.endswith("\n...\n"), f"{path.name} must end with '...' followed by a single newline" - - -def is_deprecated(schema_id_or_tag): - return any(p.match(schema_id_or_tag) for p in DEPRECATED_PATTERNS) - - -def split_id(schema_id): - return schema_id.rsplit("-", 1) - - -def yaml_tag_to_id(yaml_tag): - return "http://stsci.edu/schemas/asdf/" + yaml_tag.replace("!", "") - - -def _relative_stem(path): - return f"{str((path.parent).relative_to(SCHEMAS_PATH))}/{str(path.stem)}" - - -def path_to_tag(path): - return f"tag:stsci.edu:asdf/{_relative_stem(path)}" - - -def tag_to_path(tag): - assert tag.startswith("tag:stsci.edu:asdf/") - - return SCHEMAS_PATH / f"""{tag.split("tag:stsci.edu:asdf/")[-1]}.yaml""" - - -def tag_to_id(tag): - assert tag.startswith("tag:stsci.edu:asdf/") - - return "http://stsci.edu/schemas/asdf/" + tag.split("tag:stsci.edu:asdf/")[-1] - - -def path_to_id(path): - return f"http://stsci.edu/schemas/asdf/{_relative_stem(path)}" - - -def list_schema_paths(path): - return sorted(p for p in path.glob("**/*.yaml") if not p.name.startswith("version_map-")) - - -def list_latest_schema_paths(path): - paths = list_schema_paths(path) - - latest_by_id_base = {} - for path in paths: - schema_id = path_to_id(path) - id_base, version = split_id(schema_id) - if id_base in latest_by_id_base: - if Version(version) > Version(latest_by_id_base[id_base][0]): - latest_by_id_base[id_base] = (version, path) - else: - latest_by_id_base[id_base] = (version, path) - - return sorted(p for _, p in latest_by_id_base.values()) - - -def get_latest_schemas(): - return [load_yaml(p) for p in list_latest_schema_paths(SCHEMAS_PATH)] - - -def ref_to_id(schema_id, ref): - return urljoin(schema_id, ref) - - -def list_refs(schema): - refs = [] - if isinstance(schema, dict): - for key, value in schema.items(): - if key == "$ref": - refs.append(value) - elif isinstance(value, dict) or isinstance(value, list): - refs.extend(list_refs(value)) - elif isinstance(schema, list): - for elem in schema: - refs.extend(list_refs(elem)) - return refs - - -def list_example_ids(schema): - if "examples" in schema: - example_yaml_tags = set() - for example in schema["examples"]: - if len(example) == 1: - example = example[0] - elif len(example) == 2: - example = example[1] - elif len(example) > 2: - example = example[2] - else: - raise RuntimeError(f"Invalid example: {example}") - example_yaml_tags.update(YAML_TAG_RE.findall(example)) - return sorted({yaml_tag_to_id(yaml_tag) for yaml_tag in example_yaml_tags}) - else: - return [] - - -def list_description_ids(schema): - result = set() - if "description" in schema: - for ref in DESCRIPTION_REF_RE.findall(schema["description"]): - if not ref.startswith("http:"): - ref = "http://stsci.edu/schemas/asdf/" + ref - result.add(ref) - return result diff --git a/tests/__init__.py b/tests/.gitkeep similarity index 100% rename from tests/__init__.py rename to tests/.gitkeep diff --git a/tests/common.py b/tests/common.py index 97048594..5528ab8a 100644 --- a/tests/common.py +++ b/tests/common.py @@ -1,76 +1,166 @@ +import re from pathlib import Path +from urllib.parse import urljoin -from asdf_standard.tests.common import ( - MANIFESTS_PATH, - SCHEMAS_PATH, - get_latest_schemas, - get_schema_ids, - list_latest_schema_paths, - list_schema_paths, - load_yaml, -) +import yaml +from packaging.version import Version ROOT_PATH = Path(__file__).parent.parent -DOCS_SCHEMAS_PATH = ROOT_PATH / "docs" / "source" / "schemas" + +RESOURCES_PATH = ROOT_PATH / "resources" + +SCHEMAS_PATH = RESOURCES_PATH / "schemas" / "stsci.edu" / "asdf" +DOCS_PATH = ROOT_PATH / "docs" / "source" +DOCS_SCHEMAS_PATH = DOCS_PATH / "schemas" +YAML_SCHEMA_PATH = RESOURCES_PATH / "schemas" / "stsci.edu" / "yaml-schema" + +MANIFESTS_PATH = RESOURCES_PATH / "manifests" / "asdf-format.org" / "core" + +VERSION_MAP_PATHS = list(SCHEMAS_PATH.glob("version_map-*.yaml")) + +VALID_YAML_VERSIONS = {"1.1"} +VALID_FILE_FORMAT_VERSIONS = {"1.0.0"} + +VALID_SCHEMA_FILENAME_RE = re.compile(r"[a-z0-9_]+-[0-9]+\.[0-9]+\.[0-9]+\.yaml") + +DEPRECATED_PATTERNS = {re.compile(".*/transform/.*"), re.compile(".*/wcs/.*")} + +METASCHEMA_ID = "http://stsci.edu/schemas/yaml-schema/draft-01" + +YAML_TAG_RE = re.compile(r"![a-z/0-9_-]+-[0-9]+\.[0-9]+\.[0-9]") + +DESCRIPTION_REF_RE = re.compile(r"\(ref:(.*?)\)") SCHEMA_ID_PREFIX = "http://stsci.edu/schemas/asdf/" MANIFEST_ID_PREFIX = "asdf://asdf-format.org/core/manifests/" -def add_schemas(path, prefix, result): - with open(path) as f: +def load_yaml(path): + with path.open() as f: + return yaml.safe_load(f.read()) + + +def assert_yaml_header_and_footer(path): + with path.open() as f: content = f.read() - lines = content.split("\n") - i = 0 - while i < len(lines): - if lines[i].startswith(".. asdf-autoschemas::"): - i += 1 - while i < len(lines) and (lines[i].strip() == "" or lines[i].startswith(" ")): - possible_id = lines[i].strip() - if len(possible_id) > 0: - result.append(f"{prefix}{possible_id}") - i += 1 - else: - i += 1 + assert any( + content.startswith(f"%YAML {v}\n---\n") for v in VALID_YAML_VERSIONS + ), f"{path.name} must start with a %YAML directive with a supported version" + assert content.endswith("\n...\n"), f"{path.name} must end with '...' followed by a single newline" -def list_legacy_schema_paths(path): - paths = list_schema_paths(path) - latest_paths = list_latest_schema_paths(path) - return sorted(p for p in paths if p not in latest_paths) +def is_deprecated(schema_id_or_tag): + return any(p.match(schema_id_or_tag) for p in DEPRECATED_PATTERNS) -def latest_schema_ids(): - return get_schema_ids(get_latest_schemas()) +def split_id(schema_id): + return schema_id.rsplit("-", 1) -def legacy_schema_ids(): - return get_schema_ids([load_yaml(p) for p in list_legacy_schema_paths(SCHEMAS_PATH)]) +def yaml_tag_to_id(yaml_tag): + return "http://stsci.edu/schemas/asdf/" + yaml_tag.replace("!", "") -def manifest_ids(): - return get_schema_ids([load_yaml(p) for p in list_schema_paths(MANIFESTS_PATH)]) +def _relative_stem(path): + return f"{str((path.parent).relative_to(SCHEMAS_PATH))}/{str(path.stem)}" -def docs_schema_ids(): - result = [] - for path in DOCS_SCHEMAS_PATH.glob("**/*.rst"): - if path != DOCS_SCHEMAS_PATH / "manifest.rst": - add_schemas(path, SCHEMA_ID_PREFIX, result) - return result +def path_to_tag(path): + return f"tag:stsci.edu:asdf/{_relative_stem(path)}" -def docs_legacy_schema_ids(): - result = [] - for path in DOCS_SCHEMAS_PATH.glob("**/legacy.rst"): - add_schemas(path, SCHEMA_ID_PREFIX, result) - return result +def tag_to_path(tag): + assert tag.startswith("tag:stsci.edu:asdf/") + + return SCHEMAS_PATH / f"""{tag.split("tag:stsci.edu:asdf/")[-1]}.yaml""" + + +def tag_to_id(tag): + assert tag.startswith("tag:stsci.edu:asdf/") + + return "http://stsci.edu/schemas/asdf/" + tag.split("tag:stsci.edu:asdf/")[-1] + + +def id_to_path(id): + assert id.startswith("http://stsci.edu/schemas/asdf/") + + return SCHEMAS_PATH / f"""{id.split("http://stsci.edu/schemas/asdf/")[-1]}.yaml""" + + +def path_to_id(path): + return f"http://stsci.edu/schemas/asdf/{_relative_stem(path)}" + + +def list_schema_paths(path): + return sorted(p for p in path.glob("**/*.yaml") if not p.name.startswith("version_map-")) + + +def list_latest_schema_paths(path): + paths = list_schema_paths(path) + + latest_by_id_base = {} + for path in paths: + schema_id = path_to_id(path) + id_base, version = split_id(schema_id) + if id_base in latest_by_id_base: + if Version(version) > Version(latest_by_id_base[id_base][0]): + latest_by_id_base[id_base] = (version, path) + else: + latest_by_id_base[id_base] = (version, path) + + return sorted(p for _, p in latest_by_id_base.values()) + + +def list_legacy_schema_paths(path): + paths = list_schema_paths(path) + latest_paths = list_latest_schema_paths(path) + + return sorted(p for p in paths if p not in latest_paths) -def docs_manifest_ids(): - result = [] - for path in DOCS_SCHEMAS_PATH.glob("**/manifest.rst"): - add_schemas(path, MANIFEST_ID_PREFIX, result) +def ref_to_id(schema_id, ref): + return urljoin(schema_id, ref) + + +def list_refs(schema): + refs = [] + if isinstance(schema, dict): + for key, value in schema.items(): + if key == "$ref": + refs.append(value) + elif isinstance(value, dict) or isinstance(value, list): + refs.extend(list_refs(value)) + elif isinstance(schema, list): + for elem in schema: + refs.extend(list_refs(elem)) + return refs + + +def list_example_ids(schema): + if "examples" in schema: + example_yaml_tags = set() + for example in schema["examples"]: + if len(example) == 1: + example = example[0] + elif len(example) == 2: + example = example[1] + elif len(example) > 2: + example = example[2] + else: + raise RuntimeError(f"Invalid example: {example}") + example_yaml_tags.update(YAML_TAG_RE.findall(example)) + return sorted({yaml_tag_to_id(yaml_tag) for yaml_tag in example_yaml_tags}) + else: + return [] + + +def list_description_ids(schema): + result = set() + if "description" in schema: + for ref in DESCRIPTION_REF_RE.findall(schema["description"]): + if not ref.startswith("http:"): + ref = "http://stsci.edu/schemas/asdf/" + ref + result.add(ref) return result diff --git a/src/asdf_standard/tests/conftest.py b/tests/conftest.py similarity index 70% rename from src/asdf_standard/tests/conftest.py rename to tests/conftest.py index 0390bd10..b315a252 100644 --- a/src/asdf_standard/tests/conftest.py +++ b/tests/conftest.py @@ -1,16 +1,19 @@ import pytest from common import ( + DOCS_SCHEMAS_PATH, + MANIFEST_ID_PREFIX, + MANIFESTS_PATH, METASCHEMA_ID, + SCHEMA_ID_PREFIX, SCHEMAS_PATH, VALID_SCHEMA_FILENAME_RE, YAML_SCHEMA_PATH, assert_yaml_header_and_footer, - get_latest_schemas, - get_schema_ids, - get_tag, is_deprecated, list_description_ids, list_example_ids, + list_latest_schema_paths, + list_legacy_schema_paths, list_refs, list_schema_paths, load_yaml, @@ -27,6 +30,11 @@ def schemas(): return [load_yaml(p) for p in list_schema_paths(SCHEMAS_PATH)] +@pytest.fixture(scope="session") +def manifests(): + return [load_yaml(p) for p in list_schema_paths(MANIFESTS_PATH)] + + @pytest.fixture(scope="session") def yaml_schemas(): return [load_yaml(p) for p in list_schema_paths(YAML_SCHEMA_PATH)] @@ -34,7 +42,20 @@ def yaml_schemas(): @pytest.fixture(scope="session") def latest_schemas(): - return get_latest_schemas() + return [load_yaml(p) for p in list_latest_schema_paths(SCHEMAS_PATH)] + + +@pytest.fixture(scope="session") +def legacy_schemas(): + return [load_yaml(p) for p in list_legacy_schema_paths(SCHEMAS_PATH)] + + +def get_schema_ids(schemas): + result = set() + for schema in schemas: + if "id" in schema: + result.add(schema["id"]) + return result @pytest.fixture(scope="session") @@ -42,11 +63,74 @@ def latest_schema_ids(latest_schemas): return get_schema_ids(latest_schemas) +@pytest.fixture(scope="session") +def legacy_schema_ids(legacy_schemas): + return get_schema_ids(legacy_schemas) + + +@pytest.fixture(scope="session") +def manifest_ids(manifests): + return get_schema_ids(manifests) + + +def add_schemas(path, prefix, result): + with open(path) as f: + content = f.read() + + lines = content.split("\n") + i = 0 + while i < len(lines): + if lines[i].startswith(".. asdf-autoschemas::"): + i += 1 + while i < len(lines) and (lines[i].strip() == "" or lines[i].startswith(" ")): + possible_id = lines[i].strip() + if len(possible_id) > 0: + result.append(f"{prefix}{possible_id}") + i += 1 + else: + i += 1 + + +@pytest.fixture(scope="session") +def docs_schema_ids(): + result = [] + for path in DOCS_SCHEMAS_PATH.glob("**/*.rst"): + if path != DOCS_SCHEMAS_PATH / "manifest.rst": + add_schemas(path, SCHEMA_ID_PREFIX, result) + return result + + +@pytest.fixture(scope="session") +def docs_legacy_schema_ids(): + result = [] + for path in DOCS_SCHEMAS_PATH.glob("**/legacy.rst"): + add_schemas(path, SCHEMA_ID_PREFIX, result) + return result + + +@pytest.fixture(scope="session") +def docs_manifest_ids(): + result = [] + for path in DOCS_SCHEMAS_PATH.glob("**/manifest.rst"): + add_schemas(path, MANIFEST_ID_PREFIX, result) + return result + + +def _get_tag(schema): + if "tag" in schema: + return schema["tag"] + elif "anyOf" in schema: + for elem in schema["anyOf"]: + if "tag" in elem: + return elem["tag"] + return None + + @pytest.fixture(scope="session") def latest_schema_tags(latest_schemas): result = set() for schema in latest_schemas: - tag = get_tag(schema) + tag = _get_tag(schema) if tag is not None: result.add(tag) return result @@ -56,7 +140,7 @@ def latest_schema_tags(latest_schemas): def schema_tags(schemas): result = set() for schema in schemas: - tag = get_tag(schema) + tag = _get_tag(schema) if tag is not None: result.add(tag) return result @@ -66,7 +150,7 @@ def schema_tags(schemas): def tag_to_schema(schemas): result = {} for schema in schemas: - tag = get_tag(schema) + tag = _get_tag(schema) if tag is not None: if tag not in result: result[tag] = [] diff --git a/src/asdf_standard/tests/test_asdf_schema.py b/tests/test_asdf_schema.py similarity index 100% rename from src/asdf_standard/tests/test_asdf_schema.py rename to tests/test_asdf_schema.py diff --git a/src/asdf_standard/tests/test_core.py b/tests/test_core.py similarity index 100% rename from src/asdf_standard/tests/test_core.py rename to tests/test_core.py diff --git a/tests/test_docs.py b/tests/test_docs.py index 739f834f..707ea4e4 100644 --- a/tests/test_docs.py +++ b/tests/test_docs.py @@ -1,7 +1,6 @@ import collections -import tests.common as common -from asdf_standard.tests.common import is_deprecated +from common import is_deprecated EXCEPTIONS = { "tag:stsci.edu:asdf/asdf-schema-1.0.0", @@ -10,18 +9,13 @@ } -def test_docs_schema_links(): +def test_docs_schema_links( + latest_schema_ids, legacy_schema_ids, manifest_ids, docs_schema_ids, docs_legacy_schema_ids, docs_manifest_ids +): """ Confirm that the latest versions of all non-deprecated schemas are represented in the documentation. """ - latest_schema_ids = common.latest_schema_ids() - legacy_schema_ids = common.legacy_schema_ids() - manifest_ids = common.manifest_ids() - docs_schema_ids = common.docs_schema_ids() - docs_legacy_schema_ids = common.docs_legacy_schema_ids() - docs_manifest_ids = common.docs_manifest_ids() - expected_schema_ids = set() for schema_id in latest_schema_ids: if not is_deprecated(schema_id): @@ -70,7 +64,7 @@ def test_docs_schema_links(): assert False, message counter = collections.Counter(docs_schema_ids) - if len(counter.values()) > 0 and max(counter.values()) > 1: + if max(counter.values()) > 1: remove_list = "\n".join(sorted(tag for tag, count in counter.items() if count > 1)) message = "The documentation contains duplicate links to the following schemas: \n" f"{remove_list}" assert False, message diff --git a/src/asdf_standard/tests/test_fits.py b/tests/test_fits.py similarity index 100% rename from src/asdf_standard/tests/test_fits.py rename to tests/test_fits.py diff --git a/src/asdf_standard/tests/test_integration.py b/tests/test_integration.py similarity index 82% rename from src/asdf_standard/tests/test_integration.py rename to tests/test_integration.py index 88500235..fb3108f0 100644 --- a/src/asdf_standard/tests/test_integration.py +++ b/tests/test_integration.py @@ -1,11 +1,14 @@ +from pathlib import Path + import asdf import pytest import yaml -from common import RESOURCES_PATH def get_resources(): - return {str(path.relative_to(RESOURCES_PATH)): path for path in RESOURCES_PATH.glob("**/*.yaml")} + resources_root = Path(__file__).parent.parent / "resources" + + return {str(path.relative_to(resources_root)): path for path in resources_root.glob("**/*.yaml")} RESOURCES = get_resources() @@ -26,7 +29,7 @@ def test_resource(resource): def get_manifests(): - manifests_root = RESOURCES_PATH / "manifests" / "asdf-format.org" + manifests_root = Path(__file__).parent.parent / "resources" / "manifests" / "asdf-format.org" return {str(path.relative_to(manifests_root)): path for path in manifests_root.glob("**/*.yaml")} diff --git a/src/asdf_standard/tests/test_manifests.py b/tests/test_manifests.py similarity index 100% rename from src/asdf_standard/tests/test_manifests.py rename to tests/test_manifests.py diff --git a/src/asdf_standard/tests/test_resource.py b/tests/test_resource.py similarity index 100% rename from src/asdf_standard/tests/test_resource.py rename to tests/test_resource.py diff --git a/src/asdf_standard/tests/test_time.py b/tests/test_time.py similarity index 100% rename from src/asdf_standard/tests/test_time.py rename to tests/test_time.py diff --git a/src/asdf_standard/tests/test_unit.py b/tests/test_unit.py similarity index 100% rename from src/asdf_standard/tests/test_unit.py rename to tests/test_unit.py diff --git a/src/asdf_standard/tests/test_version_map.py b/tests/test_version_map.py similarity index 96% rename from src/asdf_standard/tests/test_version_map.py rename to tests/test_version_map.py index 31f5027e..af6f55c0 100644 --- a/src/asdf_standard/tests/test_version_map.py +++ b/tests/test_version_map.py @@ -17,10 +17,7 @@ SORTED_PATHS = sorted(VERSION_MAP_PATHS, key=lambda p: Version(split_id(path_to_id(p))[1])) -if len(SORTED_PATHS) > 0: - LATEST_PATH = SORTED_PATHS[-1] -else: - LATEST_PATH = None +LATEST_PATH = SORTED_PATHS[-1] @pytest.mark.parametrize("path", VERSION_MAP_PATHS) @@ -50,7 +47,6 @@ def test_version_map(path, schema_tags): assert False, message -@pytest.mark.skipif(LATEST_PATH is None, reason="No version maps found") def test_latest_version_map(latest_schema_tags): """ The current latest version map has some special requirements. diff --git a/src/asdf_standard/tests/test_wcs.py b/tests/test_wcs.py similarity index 100% rename from src/asdf_standard/tests/test_wcs.py rename to tests/test_wcs.py diff --git a/src/asdf_standard/tests/test_yaml_schema.py b/tests/test_yaml_schema.py similarity index 100% rename from src/asdf_standard/tests/test_yaml_schema.py rename to tests/test_yaml_schema.py