cancerDHC / ccdhmodel

CRDC-H model in LinkML, developed by the Center for Cancer Data Harmonization (CCDH)
https://cancerdhc.github.io/ccdhmodel/
BSD 3-Clause "New" or "Revised" License
16 stars 8 forks source link

Fix PyPI package generation #122

Closed gaurav closed 3 years ago

gaurav commented 3 years ago

I found a bug in the PyPI package generation -- the generated .whl and .tar.gz files didn't actually contain the crdch_model.py program. Luckily, it was a pretty easy fix, and crdch-model v1.1.1 contains the files and seems to work with the Example Data Workflow.

I don't think the data files are being included, either; there's some example syntax in https://setuptools.pypa.io/en/latest/userguide/declarative_config.html that might help.

Closes #69.

gaurav commented 3 years ago

We definitely need to add linkml-model as a prereq in the generated PyPI model.

gaurav commented 3 years ago

Okay, I think I've added linkml-runtime as a prereq.

@turbomam I haven't been able to figure out how to get setup.cfg to include crdch_model as the top-level object (i.e. you would still need from crdch_model import crdch_model to access the objects in it. However, I have figured out how to do that with Poetry (PR #127). It might be worth switching over to that if that feature is really important to you.

Another option would be to rename the file from crdch_model/crdch_model.py to crdch/model.py. That way, you'll need to run from crdch import model, which... works better? Maybe? I dunno.

I'd love to know your thoughts, and if we need more time, we can discuss this on the Thursday call.

gaurav commented 3 years ago

@turbomam Oh, I should have mentioned:

turbomam commented 3 years ago

from crdch_model import crdch_model is fine with me, I just kept forgetting to write it that way. @sujaypatil96 is making a good case for Poetry, so I wouldn't object to that either. I'm looking at the 1.1.2 and 1.1.3 packages now.

sujaypatil96 commented 3 years ago

Looks good @gaurav.🚀 I tried the importing the module and the associated dataclasses like from crdch_model import crdch_model and everything works as expected.

Right, +1 for PR #127, I think this is all the more reason to start adopting poetry.