Bulk FHIR Gen 3 Authorization Tagging - #313
Conversation
… remove unecessary dependencies
| cdisutilstest = { git = "https://github.com/uc-cdis/cdisutils-test.git", tag = "2.0.0" } | ||
| indexd = { git = "https://github.com/uc-cdis/indexd.git", tag = "5.0.4" } | ||
| deptry = "^0.23.1" | ||
| setuptools = "<82" |
There was a problem hiding this comment.
why was this necessary? let's try without it
There was a problem hiding this comment.
- Pytest version needs to be update to at least 7+
- If I don't pin setuptools version, and it installs version 84, I get this error:
gen3sdk-python/tests/conftest.py'.
tests/conftest.py:11: in
from drsclient.client import DrsClient
../../../Library/Caches/pypoetry/virtualenvs/gen3-x8jGTXip-py3.13/lib/python3.13/site-packages/drsclient/init.py:1: in
import pkg_resources
E ModuleNotFoundError: No module named 'pkg_resources'
There was a problem hiding this comment.
and in the original gen3sdk poetry lock there is this, so I think the setuptools verion has to be below 82 in the way it is written now:
[[package]]
name = "setuptools"
version = "80.9.0"
description = "Easily download, build, install, upgrade, and uninstall Python packages"
optional = false
python-versions = ">=3.9"
groups = ["main", "dev"]
files = [
{file = "setuptools-80.9.0-py3-none-any.whl", hash = "sha256:062d34222ad13e0cc312a4c02d73f059e86a4acbfbdea8f8f76b28c99f306922"},
{file = "setuptools-80.9.0.tar.gz", hash = "sha256:f36b47402ecde768dbfafc46e8e4207b4360c654f1f3bb84475f0a28628fb19c"},
]
There was a problem hiding this comment.
try this file (it worked for me):
[tool.poetry]
name = "gen3"
homepage = "https://gen3.org/"
version = "4.29.0"
description = "Gen3 CLI and Python SDK"
authors = ["Center for Translational Data Science at the University of Chicago <support@gen3.org>"]
license = "Apache-2.0"
packages = [
{ include = "gen3" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering",
]
[tool.poetry.dependencies]
python = ">=3.9, <4"
requests = "*"
indexclient = ">=2.3.0"
drsclient = ">=0.3.0"
aiohttp = "*"
backoff = "*"
cdislogging = ">=1.1.0"
click = "*"
importlib_metadata = ">=8,<9"
jsonschema = "*"
# FIXME updating to >=0.6.0 breaks a few tests
dataclasses-json = "<=0.5.9"
pypfb = ">=0.6.2"
tqdm = ">=4.61.2"
humanfriendly ="*"
python-dateutil = "*"
aiofiles = "*"
pandas = ">=1.4.2"
xmltodict = ">=0.13.0"
gen3users = "*"
# A list of all of the optional dependencies, some of which are included in the
# below `extras`. They can be opted into by apps.
fhirclient = { version = "*", optional = true }
fhirpathpy = { version = "*", optional = true }
[tool.poetry.extras]
fhir = ["fhirclient", "fhirpathpy"]
[tool.poetry.group.dev.dependencies]
pytest = ">=7.0"
pytest-cov = "*"
requests-mock = "*"
cdisutilstest = { git = "https://github.com/uc-cdis/cdisutils-test.git", tag = "2.0.0" }
indexd = { git = "https://github.com/uc-cdis/indexd.git", tag = "5.0.4" }
deptry = ">=0.23.1"
[tool.poetry.scripts]
gen3 = "gen3.cli.__main__:main"
[tool.poetry.plugins."gen3.plugins"]
[build-system]
requires = ["poetry>=1.4.1"]
build-backend = "poetry.masonry.api"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-vv"
testpaths = [
"tests",
]There was a problem hiding this comment.
I checked again and this doesnt work...
ImportError while loading conftest 'gen3sdk-python/tests/conftest.py'.
tests/conftest.py:11: in <module>
from drsclient.client import DrsClient
../../../Library/Caches/pypoetry/virtualenvs/gen3-x8jGTXip-py3.13/lib/python3.13/site-packages/drsclient/__init__.py:1: in <module>
import pkg_resources
E ModuleNotFoundError: No module named 'pkg_resources'
…d functions, included more details in --help
| cdisutilstest = { git = "https://github.com/uc-cdis/cdisutils-test.git", tag = "2.0.0" } | ||
| indexd = { git = "https://github.com/uc-cdis/indexd.git", tag = "5.0.4" } | ||
| deptry = "^0.23.1" | ||
| setuptools = "<82" |
There was a problem hiding this comment.
try this file (it worked for me):
[tool.poetry]
name = "gen3"
homepage = "https://gen3.org/"
version = "4.29.0"
description = "Gen3 CLI and Python SDK"
authors = ["Center for Translational Data Science at the University of Chicago <support@gen3.org>"]
license = "Apache-2.0"
packages = [
{ include = "gen3" },
]
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering",
]
[tool.poetry.dependencies]
python = ">=3.9, <4"
requests = "*"
indexclient = ">=2.3.0"
drsclient = ">=0.3.0"
aiohttp = "*"
backoff = "*"
cdislogging = ">=1.1.0"
click = "*"
importlib_metadata = ">=8,<9"
jsonschema = "*"
# FIXME updating to >=0.6.0 breaks a few tests
dataclasses-json = "<=0.5.9"
pypfb = ">=0.6.2"
tqdm = ">=4.61.2"
humanfriendly ="*"
python-dateutil = "*"
aiofiles = "*"
pandas = ">=1.4.2"
xmltodict = ">=0.13.0"
gen3users = "*"
# A list of all of the optional dependencies, some of which are included in the
# below `extras`. They can be opted into by apps.
fhirclient = { version = "*", optional = true }
fhirpathpy = { version = "*", optional = true }
[tool.poetry.extras]
fhir = ["fhirclient", "fhirpathpy"]
[tool.poetry.group.dev.dependencies]
pytest = ">=7.0"
pytest-cov = "*"
requests-mock = "*"
cdisutilstest = { git = "https://github.com/uc-cdis/cdisutils-test.git", tag = "2.0.0" }
indexd = { git = "https://github.com/uc-cdis/indexd.git", tag = "5.0.4" }
deptry = ">=0.23.1"
[tool.poetry.scripts]
gen3 = "gen3.cli.__main__:main"
[tool.poetry.plugins."gen3.plugins"]
[build-system]
requires = ["poetry>=1.4.1"]
build-backend = "poetry.masonry.api"
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-vv"
testpaths = [
"tests",
]| import subprocess | ||
| import shutil | ||
|
|
||
| TMP_ROOT = pathlib.Path("./tests/test_data/fhir_outputs") |
There was a problem hiding this comment.
we should look into https://docs.pytest.org/en/7.1.x/how-to/tmp_path.html instead of a relative path here, b/c this requires you to run from root to get the outputs in the expected place to .gitignore
The side effect of this is exactly what I think were seeing with the tests/tests/outputs files you accidentally checked in. Those likely used relative paths from wherever the script was run, and you probably ran it with tests/ as the root instead of the repo root at some point.
You don't have to fix it there - but we shouldn't repeat that pattern here
There was a problem hiding this comment.
tests/tests/outputs - these outputs are from the other tests, mine are linked to be within test_data/fhir_output, I forgot to delete the other ones.
I did try to use the pytest tmp_path, the TMP_ROOT is just defining what i want that path to be. Maybe I'm still confused on how to use it:
@pytest.fixture(scope="session") def tmp_root(tmp_path_factory): return tmp_path_factory.mktemp(TMP_ROOT)
I then pass tmp_root to all the tests which require it
There was a problem hiding this comment.
can we try to do it without the root being specified?
Temporary directories are by default created as sub-directories of the system temporary directory the docs claim this
…h, update function descriptions
…t in the unit tests
New Features
Dependency updates