diff --git a/.github/.remarkrc b/.github/.remarkrc deleted file mode 100644 index f5aae5f..0000000 --- a/.github/.remarkrc +++ /dev/null @@ -1,11 +0,0 @@ -{ - "plugins": [ - "remark-gfm", - "remark-preset-lint-consistent", - "remark-preset-lint-recommended", - "validate-links", - ["remark-lint-maximum-line-length", 100], - ["remark-lint-list-item-indent", "mixed"], - ["remark-lint-no-shortcut-reference-link", false] - ] -} \ No newline at end of file diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index fa08a5f..69948b9 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -6,14 +6,15 @@ jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/setup-node@v4 - with: - node-version: 'lts/*' - uses: actions/setup-python@v5 with: python-version: '>=3.9' - uses: actions/checkout@v4 - - run: | - npm install - npm run init - npm test + - name: Install pipenv + run: | + pip install pipenv + pipenv install + - run: pipenv run test-docs +# - run: pipenv run test-schema + - run: pipenv run test-geojson + - run: pipenv run test-geoparquet diff --git a/.gitignore b/.gitignore index 8ab09c2..c4ebea5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,5 @@ Thumbs.db /.idea/ /.vscode/ -# Node / npm -.npm -/node_modules/ -package-lock.json \ No newline at end of file +# Python +Pipfile.lock \ No newline at end of file diff --git a/CONRIBUTING.md b/CONRIBUTING.md new file mode 100644 index 0000000..771ebb5 --- /dev/null +++ b/CONRIBUTING.md @@ -0,0 +1,23 @@ +# Contributing + +All contributions are subject to the +[fiboa Code of Conduct](https://github.com/fiboa/specification/blob/main/CODE_OF_CONDUCT.md). +For contributions, please follow the +[fiboa contributing guideline](https://github.com/fiboa/specification/blob/main/CONTRIBUTING.md). + +## Running tests + +You'll need to install Python >= 3.9 and pip to setup the test environment. +We use pipenv to execute the tests. + +Start with the following command in the folder where this README is located: +`pip install pipenv --user` + +Finally, you can run the tests as follows: + +- To check the markdown run: `pipenv run test-docs` +- To check the fiboa schema run: `pipenv run test-schema` +- To check the examples run: + - `pipenv run test-geojson` for GeoJSON + - `pipenv run test-geoparquet` for GeoParquet +- To create a GeoParquet from the GeoJSON examples: `pipenv run create-geoparquet` diff --git a/Pipfile b/Pipfile new file mode 100644 index 0000000..b3233c1 --- /dev/null +++ b/Pipfile @@ -0,0 +1,15 @@ +[[source]] +url = "https://pypi.org/simple" +verify_ssl = true +name = "pypi" + +[packages] +fiboa-cli = ">=0.3" +pymarkdownlnt = ">=0.9" + +[scripts] +test-docs = "pymarkdown -d md024 scan ." +test-schema = "fiboa validate-schema schema/schema.yaml" +test-geojson = "fiboa validate examples/geojson -c examples/geojson/collection.json -e https://fiboa.github.io/extension-template/v0.1.0/schema.yaml,schema/schema.yaml" +test-geoparquet = "fiboa validate examples/geoparquet -e https://fiboa.github.io/extension-template/v0.1.0/schema.yaml,schema/schema.yaml" +create-geoparquet = "fiboa create-geoparquet examples/geojson -o examples/geoparquet/example.parquet -c examples/geojson/collection.json -e https://fiboa.github.io/extension-template/v0.1.0/schema.yaml,schema/schema.yaml" diff --git a/README.md b/README.md index 5b3fb10..c09abc9 100644 --- a/README.md +++ b/README.md @@ -31,23 +31,4 @@ The fields in the table below can be used in these parts of fiboa documents: ## Contributing -All contributions are subject to the -[fiboa Code of Conduct](https://github.com/fiboa/specification/blob/main/CODE_OF_CONDUCT.md). -For contributions, please follow the -[fiboa contributing guideline](https://github.com/fiboa/specification/blob/main/CONTRIBUTING.md). - -### Running tests - -You'll need to install [nodejs and npm](https://nodejs.org/en/download/) to run the tests. -Alternatively, you can also use [yarn](https://yarnpkg.com/) instead of npm. -In this case replace all occurrences of `npm` with `yarn` below. -Additionally, you need Python >= 3.9 installed. - -Afterwards, navigate to the root of the specification repository. -Now, install the required test software: `npm install` and `npm run init` - -Finally, you can run all tests or subset of them: - -- To run all tests: `npm test` -- To check the markdown run: `npm run check-docs` -- To check the examples run: `npm run check-examples` +See the [contributing guideline](CONTRIBUTING.md) for more details. diff --git a/examples/geojson/collection.json b/examples/geojson/collection.json index c275cd4..4a5ef20 100644 --- a/examples/geojson/collection.json +++ b/examples/geojson/collection.json @@ -1,43 +1,6 @@ { - "fiboa_version": "0.1.0", + "fiboa_version": "0.2.0", "fiboa_extensions": [ "https://fiboa.github.io/extension-template/v0.1.0/schema.yaml" - ], - "stac_version": "1.0.0", - "type": "Collection", - "id": "fiboa", - "description": "An example fiboa dataset", - "license": "CC-0", - "extent": { - "spatial": { - "bbox": [ - [ - -180, - -90, - 180, - 90 - ] - ] - }, - "temporal": { - "interval": [ - [ - "2019-01-01T00:00:00Z", - "2020-01-01T00:00:00Z" - ] - ] - } - }, - "links": [ - { - "rel": "item", - "href": "example.json", - "type": "application/geo+json" - }, - { - "rel": "item", - "href": "example.parquet", - "type": "application/vnd.apache.parquet" - } ] } \ No newline at end of file diff --git a/examples/geoparquet/example.parquet b/examples/geoparquet/example.parquet index e6f4eb9..3686221 100644 Binary files a/examples/geoparquet/example.parquet and b/examples/geoparquet/example.parquet differ diff --git a/package.json b/package.json deleted file mode 100644 index aa43e1c..0000000 --- a/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "fiboa-extension-template", - "version": "0.1.0", - "license": "Apache-2.0", - "scripts": { - "test": "npm run check-docs && npm run check-geojson-examples && npm run check-geoparquet-examples", - "check-geojson-examples": "fiboa-geojson-validator validate examples/geojson -c examples/geojson/collection.json -e https://fiboa.github.io/extension-template/v0.1.0/schema.yaml,schema/schema.yaml", - "init": "pip install fiboa-cli", - "check-geoparquet-examples": "fiboa validate examples/geoparquet -e https://fiboa.github.io/extension-template/v0.1.0/schema.yaml,schema/schema.yaml", - "create-geoparquet-example": "fiboa create examples/geojson -o examples/geoparquet/example.parquet -c examples/geojson/collection.json -e https://fiboa.github.io/extension-template/v0.1.0/schema.yaml,schema/schema.yaml", - "check-docs": "remark . -f -r .github/.remarkrc" - }, - "dependencies": { - "@fiboa/geojson-validator": "^0.1.5", - "remark-cli": "^12.0.0", - "remark-gfm": "^4.0.0", - "remark-lint": "^9.1.2", - "remark-lint-no-html": "^3.1.2", - "remark-preset-lint-consistent": "^5.1.2", - "remark-preset-lint-markdown-style-guide": "^5.1.3", - "remark-preset-lint-recommended": "^6.1.3", - "remark-validate-links": "^13.0.0" - } -} diff --git a/schema/schema.yaml b/schema/schema.yaml index cbf3bbe..b6b08b3 100644 --- a/schema/schema.yaml +++ b/schema/schema.yaml @@ -1,3 +1,6 @@ +$schema: https://fiboa.github.io/schema/v0.1.0/schema.json +required: + - template:field1 properties: template:field1: type: uint8