pachterlab / seqspec

machine-readable file format for genomic library sequence and structure
MIT License
109 stars 17 forks source link

read seqspec from URI #17

Closed hitz closed 10 months ago

hitz commented 1 year ago

It would be cool if the lib could read seqspec from a URI instead of just a local file path

hitz commented 1 year ago

ok I wrote some code to do this but don't want to expand test suite over the internet to use URIs. @sbooeshaghi how do you run tests locally?

sbooeshaghi commented 1 year ago

Hi, could you clarify what you mean by "read seqspec from URI"? Do mean something akin to

seqspec print http://myurl.com/customspec.yaml

?

sbooeshaghi commented 1 year ago

Also @detrout setup the testing framework and maybe can comment a bit about it and how to effectively write tests for new functionality.

detrout commented 1 year ago

You could either use a mocking library https://pypi.org/project/requests-mock/

or alternatively launch a local HTTP server instance to host a test seqspec. https://docs.python.org/3/library/http.server.html https://pytest-httpserver.readthedocs.io/en/latest/

hitz commented 1 year ago

seqspec print http://myurl.com/customspec.yaml

No, not the seqspec file itself, but rather the the references within it to the fastqs and index files. Ha, which means I think I modified the wrong function.

detrout commented 1 year ago

Ben asked for test documentation in slack, this look good enough for a pull request?

+Test can be run with
+```bash
+tox
+```
+Which will install pytest and pytest-cov, but requires you have already
+installed tox or
+
+```bash
+pytest --cov=seqspec
+```
+which requires that you install pytest and pytest-cov.
+
+
hitz commented 1 year ago

those should be in dev-requirements.txt right?

detrout commented 1 year ago

Yes, the package dependencies are listed in dev-requirements.

Though maybe it doesn't hurt to give people the option to ignore pip install -r dev-requirements (In case they forget it's there. like me)

sbooeshaghi commented 10 months ago

onlists can now be supplied a uri

https://github.com/IGVF/seqspec/commit/242cdf09c58cd8864a3d98f58563910cdc5fe354