diff --git a/sci-biology/bidsschematools/Manifest b/sci-biology/bidsschematools/Manifest index 9acafeb..e8df27f 100644 --- a/sci-biology/bidsschematools/Manifest +++ b/sci-biology/bidsschematools/Manifest @@ -1,2 +1,5 @@ -DIST bidsschematools-0.3.0_pre20220801.tar.gz 5716585 SHA256 b91e5707786704c6a0ee13489d78fdc0d274b334ea435bb375498c07d40933eb SHA512 524206d54a04587180dd3b150bb4e88282d62cf1273717d3caedb6b227e74102b9b5d4e68cb2b1725ad6e19641e0fbcb5ee1b2b5931fa7025f918d72e8a591a9 WHIRLPOOL 8a732807ee307fe96093c1fa9b4943d8bf5bbe07a24258460c23d2f35adb91c8cce08516dcd8c8e61d0fe2be2a34ca0d8063612697031520fa5fba083cf4be7c -DIST bidsschematools-0.3.0_rc1.tar.gz 5717759 SHA256 3789692e42d975eda76c680b53a8057c4d15b05983e879c09ab43291effa99fa SHA512 f250fd9fd88524d6d35ecd446e1b9abd7c80aa845ed08ee281f996a52e36f6e9d9eee855b752e1c7b35ae5c456eae94ca29b81e4585637286c1f535a5ec93105 WHIRLPOOL 4c6e42969a43c391af691784f4272603b0f26f173704add71891c6d9a255ae0e91444e538089c81368fdb5cc003e534425c9b95dd8f1888af3341f68cf48d613 +DIST bids-error-examples-4dee93e8dc75ea7b63c94e1657bbc94e3e77dfd0.tar.gz 666982 BLAKE2B 08f3ec9734d323dae3bcabb5a22f0bfdb3cfff114523f73aa162fb0d62145dcb1c82315b729ced59a20edc4d896247bdbfd8dbd2aa1ec293160d2c6c1b469c16 SHA512 0cd1e3d1a5e5ecb29d5fb00293910f417b5fb0e787eed42d5242c94fcdf7871b8702ef5e1125474df32c077bc7ec810c1eeec236dbca6c9f7bb6998cf2b37a9c +DIST bids-examples-252449184b532ba08c26e53e422f1e05366ac102.tar.gz 35118815 BLAKE2B d0a8f50f362158bfa200f3db56d52e88d206d667660b65533e637078b1ca8061df751d50fcf4933336e4afd32a19b76e99d6034270b0121410d0ac4046d17a26 SHA512 c4ec6b77cae211572ade803520b07ea9d49a6d2ab8ad8f2cd3f9028ea70bd1bf8e92bbdb294aaf058f1095182bfa1ff1e0e6c138508a1dd0a9879c3ab325dc36 +DIST bidsschematools-0.3.1.tar.gz 109064 BLAKE2B 9432ad8723975b20d8e64e50c44657a6fb97a01a640de8f56e32b29f6c806b3f5317c4761e9b5b567e38cdb69ae461c3e745c4de4f6f2cf648299d9376365369 SHA512 334200722d2d936abf44ea202253a46dfd6120d6dc2ce7a638abd721fdc6810e2f2172ab474883c1dcbba0de1d0e8edf8ab572af0955087375147a6d3ed76f48 +DIST bidsschematools-0.3.1_p2.tar.gz 5725503 BLAKE2B bd3722a1d89d7788317a13931756200915c868c48dce9cd7ef45fa80bbe70861b38c93f9fedb95b73fb0467654c344b1d668865032528dbf5a8ef081a80bd0f8 SHA512 b1771124c0f4b81a8c36a72fba927531b202cabd043c187115cd46826e583486727e313709c41b3b3a5e3ff8a86f18066f24d48e41505019cd1e499e7afece38 +DIST bidsschematools-0.4.0.tar.gz 1158341 BLAKE2B a47ad610936e8bb9f91ade6f234f258535364d5cd3c188544dbb25f2540138596455656a25f167b1b6417cd896e15b4e1baf140999d0dbccdfa01432b2e88783 SHA512 c42dd337a0f2402de2c4794b85382b0e422ffbd9dbc814e943f32bc95cb1d7d2bc31dc40aeef6fd792d14ec09617de289ecdb794c0d22f1154f23e2f04bd5fdd diff --git a/sci-biology/bidsschematools/bidsschematools-0.3.0_pre20220801.ebuild b/sci-biology/bidsschematools/bidsschematools-0.3.0_pre20220801.ebuild deleted file mode 100644 index c4f5074..0000000 --- a/sci-biology/bidsschematools/bidsschematools-0.3.0_pre20220801.ebuild +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{8..11} ) - -MY_HASH="54e7990387166fd206cb1f4ec4eb2187b42c08b3" - -inherit distutils-r1 - -DESCRIPTION="A Python library for working with the BIDS schema" -HOMEPAGE="https://github.com/bids-standard/bids-specification" -SRC_URI="https://github.com/bids-standard/bids-specification/archive/${MY_HASH}.tar.gz -> ${P}.tar.gz" - -LICENSE="CC-BY-SA-4.0" -SLOT="0" -KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" - -RDEPEND="dev-python/tabulate" -DEPEND="" - -S="${WORKDIR}/bids-specification-${MY_HASH}/tools/schemacode" - -distutils_enable_tests pytest - -python_test() { - # Ideally we should package the testdata packages: - # https://github.com/bids-standard/bids-examples - # https://github.com/bids-standard/bids-error-examples - export SCHEMACODE_TESTS_NONETWORK=1 - epytest -} diff --git a/sci-biology/bidsschematools/bidsschematools-0.3.0_rc1.ebuild b/sci-biology/bidsschematools/bidsschematools-0.3.1.ebuild similarity index 74% rename from sci-biology/bidsschematools/bidsschematools-0.3.0_rc1.ebuild rename to sci-biology/bidsschematools/bidsschematools-0.3.1.ebuild index aac2834..8ddabad 100644 --- a/sci-biology/bidsschematools/bidsschematools-0.3.0_rc1.ebuild +++ b/sci-biology/bidsschematools/bidsschematools-0.3.1.ebuild @@ -6,22 +6,20 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{8..11} ) -MY_HASH="14302430895d2f52d33b0e9a2c8e957c86187ce4" - inherit distutils-r1 DESCRIPTION="A Python library for working with the BIDS schema" HOMEPAGE="https://github.com/bids-standard/bids-specification" -SRC_URI="https://github.com/TheChymera/bids-specification/archive/${MY_HASH}.tar.gz -> ${P}.tar.gz" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" -LICENSE="CC-BY-SA-4.0" +LICENSE="MIT" SLOT="0" KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" RDEPEND="dev-python/tabulate" DEPEND="" -S="${WORKDIR}/bids-specification-${MY_HASH}/tools/schemacode" +#S="${WORKDIR}/bids-specification-${MY_HASH}/tools/schemacode" distutils_enable_tests pytest diff --git a/sci-biology/bidsschematools/bidsschematools-0.3.1_p2.ebuild b/sci-biology/bidsschematools/bidsschematools-0.3.1_p2.ebuild new file mode 100644 index 0000000..ae112ed --- /dev/null +++ b/sci-biology/bidsschematools/bidsschematools-0.3.1_p2.ebuild @@ -0,0 +1,65 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{8..10} ) + +#MY_PV=${PV%%_*} +#MY_P="${PN}-${MY_PV}" +MY_HASH="a87f8955b48d663eab08d7706c7302215c0e36d3" +EXAMPLES_HASH="252449184b532ba08c26e53e422f1e05366ac102" +ERROR_EXAMPLES_HASH="4dee93e8dc75ea7b63c94e1657bbc94e3e77dfd0" +inherit distutils-r1 + +DESCRIPTION="A Python library for working with the BIDS schema" +HOMEPAGE="https://github.com/bids-standard/bids-specification" +SRC_URI=" + https://github.com/bids-standard/bids-specification/archive/${MY_HASH}.tar.gz -> ${P}.tar.gz + test? ( + https://github.com/bids-standard/bids-examples/archive/${EXAMPLES_HASH}.tar.gz -> bids-examples-${EXAMPLES_HASH}.tar.gz + https://github.com/bids-standard/bids-error-examples/archive/${ERROR_EXAMPLES_HASH}.tar.gz -> bids-error-examples-${ERROR_EXAMPLES_HASH}.tar.gz + ) +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="render" + +RDEPEND=" + dev-python/pyyaml[${PYTHON_USEDEP}] + render? ( + dev-python/tabulate[${PYTHON_USEDEP}] + dev-python/pandas[${PYTHON_USEDEP}] + ) +" +DEPEND="" + +#S="${WORKDIR}/${MY_P}" +S="${WORKDIR}/bids-specification-${MY_HASH}/tools/schemacode/" + +#PATCHES=( +# "${FILESDIR}/${P}-static_testdata.patch" +#) + +distutils_enable_tests pytest + +src_prepare() { + if use test; then + mkdir "${S}/testdata" || die "Failed to create testdata directory." + cp -rf "${WORKDIR}/bids-examples-${EXAMPLES_HASH}" "${S}/testdata/bids-examples" || die "Failed to copy testdata into tree." + cp -rf "${WORKDIR}/bids-error-examples-${ERROR_EXAMPLES_HASH}" "${S}/testdata/bids-error-examples" || die "Failed to copy testdata into tree." + fi + if ! use render; then + rm "${S}/bidsschematools/render.py" + rm "${S}/bidsschematools/tests/test_render.py" + fi + default +} + +python_test() { + # We want to display INFO logging explicitly stating whether static data was used. + epytest --log-level=INFO +} diff --git a/sci-biology/bidsschematools/bidsschematools-0.4.0.ebuild b/sci-biology/bidsschematools/bidsschematools-0.4.0.ebuild new file mode 100644 index 0000000..735f130 --- /dev/null +++ b/sci-biology/bidsschematools/bidsschematools-0.4.0.ebuild @@ -0,0 +1,37 @@ +# Copyright 2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{8..10} ) + +inherit distutils-r1 + +DESCRIPTION="A Python library for working with the BIDS schema" +HOMEPAGE="https://github.com/bids-standard/bids-specification" +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="render" + +RDEPEND=" + dev-python/pyyaml[${PYTHON_USEDEP}] + render? ( + dev-python/tabulate[${PYTHON_USEDEP}] + dev-python/pandas[${PYTHON_USEDEP}] + ) +" +DEPEND="" + +distutils_enable_tests pytest + +src_prepare() { + if ! use render; then + rm "${S}/bidsschematools/render.py" + rm "${S}/bidsschematools/tests/test_render.py" + fi + default +} diff --git a/sci-biology/bidsschematools/bidsschematools-9999.ebuild b/sci-biology/bidsschematools/bidsschematools-9999.ebuild deleted file mode 100644 index a768088..0000000 --- a/sci-biology/bidsschematools/bidsschematools-9999.ebuild +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2022 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{8..11} ) - -inherit distutils-r1 git-r3 - -DESCRIPTION="A Python library for working with the BIDS schema" -HOMEPAGE="https://github.com/bids-standard/bids-specification" -EGIT_REPO_URI="git@github.com:TheChymera/bids-specification.git" -EGIT_BRANCH="release_candidate" - -LICENSE="CC-BY-SA-4.0" -SLOT="0" -KEYWORDS="" - -RDEPEND="dev-python/tabulate" -DEPEND="" - -S="${WORKDIR}/bids-specification-${MY_HASH}/tools/schemacode" - -distutils_enable_tests pytest - -python_test() { - # Ideally we should package the testdata packages: - # https://github.com/bids-standard/bids-examples - # https://github.com/bids-standard/bids-error-examples - export SCHEMACODE_TESTS_NONETWORK=1 - epytest -} diff --git a/sci-biology/bidsschematools/files/bidsschematools-0.3.1_p1-static_testdata.patch b/sci-biology/bidsschematools/files/bidsschematools-0.3.1_p1-static_testdata.patch new file mode 100644 index 0000000..dad98ff --- /dev/null +++ b/sci-biology/bidsschematools/files/bidsschematools-0.3.1_p1-static_testdata.patch @@ -0,0 +1,98 @@ +--- a/bidsschematools/tests/conftest.py ++++ b/bidsschematools/tests/conftest.py +@@ -35,29 +35,38 @@ BIDS_ERROR_SELECTION = [ + def get_gitrepo_fixture(url, whitelist): + @pytest.fixture(scope="session") + def fixture(): +- with tempfile.TemporaryDirectory() as path: +- assert os.path.exists(path) +- lgr.debug("Cloning %r into %r", url, path) +- runout = run( +- [ +- "git", +- "clone", +- "--depth=1", +- "--filter=blob:none", +- "--sparse", +- url, +- path, +- ], +- capture_output=True, +- ) +- if runout.returncode: +- raise RuntimeError(f"Failed to clone {url} into {path}") +- # cwd specification is VERY important, not only to achieve the correct +- # effects, but also to avoid dropping files from your repository if you +- # were to run `git sparse-checkout` inside the software repo. +- _ = run(["git", "sparse-checkout", "init", "--cone"], cwd=path) +- _ = run(["git", "sparse-checkout", "set"] + whitelist, cwd=path) +- yield path ++ archive_name = url.rsplit("/",1)[-1] ++ testdata_archive = os.path.join(os.getcwd(),"testdata",archive_name) ++ if os.path.isdir(testdata_archive): ++ lgr.info("Found static testdata archive under `%s`. " ++ "Not downloading latest data from version control.", testdata_archive) ++ yield testdata_archive ++ else: ++ lgr.info("No static testdata available under `%s`. " ++ "Attempting to fetch live data from version control.", testdata_archive) ++ with tempfile.TemporaryDirectory() as path: ++ assert os.path.exists(path) ++ lgr.debug("Cloning %r into %r", url, path) ++ runout = run( ++ [ ++ "git", ++ "clone", ++ "--depth=1", ++ "--filter=blob:none", ++ "--sparse", ++ url, ++ path, ++ ], ++ capture_output=True, ++ ) ++ if runout.returncode: ++ raise RuntimeError(f"Failed to clone {url} into {path}") ++ # cwd specification is VERY important, not only to achieve the correct ++ # effects, but also to avoid dropping files from your repository if you ++ # were to run `git sparse-checkout` inside the software repo. ++ _ = run(["git", "sparse-checkout", "init", "--cone"], cwd=path) ++ _ = run(["git", "sparse-checkout", "set"] + whitelist, cwd=path) ++ yield path + + return fixture + + +--- a/bidsschematools/tests/test_validator.py ++++ b/bidsschematools/tests/test_validator.py +@@ -377,7 +377,6 @@ def test_bids_datasets(bids_examples, tmp_path, dataset): + result = validate_bids( + target, + schema_version=schema_path, +- report_path=True, + ) + # Have all files been validated? + assert len(result["path_tracking"]) == 0 +--- a/bidsschematools/validator.py ++++ b/bidsschematools/validator.py +@@ -451,7 +451,7 @@ def validate_all( + + def write_report( + validation_result, +- report_path="/var/tmp/bids-validator/report_{datetime}-{pid}.log", ++ report_path="~/.cache/bidsschematools/validator-report_{datetime}-{pid}.log", + datetime_format="%Y%m%d%H%M%SZ", + ): + """Write a human-readable report based on the validation result. +@@ -481,8 +481,9 @@ def write_report( + pid=os.getpid(), + ) + report_path = os.path.abspath(os.path.expanduser(report_path)) ++ report_dir = os.path.dirname(report_path) + try: +- os.makedirs(os.path.dirname(report_path)) ++ os.makedirs(report_dir) + except OSError: + pass + + diff --git a/sci-biology/bidsschematools/metadata.xml b/sci-biology/bidsschematools/metadata.xml index d0e1856..3fac5f1 100644 --- a/sci-biology/bidsschematools/metadata.xml +++ b/sci-biology/bidsschematools/metadata.xml @@ -2,11 +2,18 @@ - chr@chymera.eu + gentoo@chymera.eu Horea Christian sci@gentoo.org Gentoo Science Project + + bids-standard/bids-specification + bidsschematools + + + Support for schema table rendering +