broadinstitute / single_cell_portal

Tutorials, workflows, and convenience scripts for Single Cell Portal
https://singlecell.broadinstitute.org/single_cell
BSD 3-Clause "New" or "Revised" License
48 stars 25 forks source link

Publish single_cell_portal to PyPI (SCP-2414) #102

Closed jlchang closed 4 years ago

jlchang commented 4 years ago

Update manage_study.py to run as an executable (manage-study) after installation of the single_cell_portal package from PyPI. Minor updates to repo (setup.py, init.py etc) for publishing to PyPI.

Currently single_cell_portal is published to TestPyPI, to install: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple single_cell_portal

Expected current behavior:

single_cell_portal installs scp-ingest-pipeline - the available version is 1.3.7 which will fail on .txt files with "_csv.Error: Could not determine delimiter"

Running manage-study against the staging server with a valid .txt metadata file against the metadata convention will fail (due to local 1.3.7 code) even though the staging server is running ingest 1.3.9

To test:

(First, rename a synthetic metadata file from .tsv to .txt)

gcloud config configurations activate default

ACCESS_TOKEN=`gcloud auth print-access-token`

STUDY_NAME=<name of a staging study w/o a current metadata file>

manage-study --environment staging --token=$ACCESS_TOKEN  upload-metadata --file metadata.txt --study-name $STUDY_NAME --use-convention

running with the same file saved as metadata.tsv should succeed

These changes support SCP-2414.

codecov[bot] commented 4 years ago

Codecov Report

Merging #102 into master will decrease coverage by 0.10%. The diff coverage is 36.47%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #102      +/-   ##
==========================================
- Coverage   17.22%   17.11%   -0.11%     
==========================================
  Files          24       24              
  Lines        3600     3622      +22     
==========================================
  Hits          620      620              
- Misses       2980     3002      +22     
Impacted Files Coverage Δ
scripts/scp_api.py 45.91% <29.19%> (-1.95%) :arrow_down:
scripts/manage_study.py 22.70% <60.71%> (-1.06%) :arrow_down:
scripts/cli_parser.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2d12b47...930c1a1. Read the comment docs.