brainspinner / cvasl

This is a repo for the Cerebrovascular Brain Age project
Apache License 2.0
4 stars 1 forks source link

Move to pyproject.toml #260

Open suvayu opened 2 months ago

suvayu commented 2 months ago

Build with python -m build .

$ unzip -l dist/cvasl-0.0.4.dev28+geba2ba7.d20240731-py3-none-any.whl 
Archive:  dist/cvasl-0.0.4.dev28+geba2ba7.d20240731-py3-none-any.whl
  Length      Date    Time    Name
---------  ---------- -----   ----
       24  06-18-2024 09:42   cvasl/__init__.py
       90  06-18-2024 09:42   cvasl/__main__.py
      467  07-31-2024 15:32   cvasl/_version.py
    20746  06-18-2024 09:42   cvasl/carve.py
     8292  06-18-2024 09:42   cvasl/cli.py
    11509  06-18-2024 09:42   cvasl/file_handler.py
    13391  07-31-2024 11:24   cvasl/harmony.py
     6500  06-18-2024 09:42   cvasl/mold.py
    37581  07-10-2024 09:23   cvasl/seperated.py
       24  06-18-2024 09:42   cvasl/vendor/__init__.py
     2791  06-18-2024 09:42   cvasl/vendor/ComBat++/README.md
      244  06-18-2024 09:42   cvasl/vendor/ComBat++/Renvironment.yml
     2054  06-18-2024 09:42   cvasl/vendor/ComBat++/Untitled.ipynb
     5785  06-18-2024 09:42   cvasl/vendor/ComBat++/combatPP.R
     3837  06-18-2024 09:42   cvasl/vendor/ComBat++/utils.R
     6148  07-10-2024 09:23   cvasl/vendor/RELIEF/.DS_Store
       28  07-10-2024 09:23   cvasl/vendor/RELIEF/.Rbuildignore
       40  07-10-2024 09:23   cvasl/vendor/RELIEF/.gitignore
      278  07-10-2024 09:23   cvasl/vendor/RELIEF/DESCRIPTION
       71  07-10-2024 09:23   cvasl/vendor/RELIEF/NAMESPACE
     2398  07-10-2024 09:23   cvasl/vendor/RELIEF/README.md
     4087  07-10-2024 09:23   cvasl/vendor/RELIEF/RELIEF.R
      300  07-31-2024 11:24   cvasl/vendor/RELIEF/relief_environment.yaml
    11356  06-18-2024 09:42   cvasl/vendor/comscan/LICENSE
     3394  06-18-2024 09:42   cvasl/vendor/comscan/README.rst
       57  07-31-2024 11:24   cvasl/vendor/comscan/__init__.py
    33465  07-31-2024 11:24   cvasl/vendor/comscan/clustering.py
      810  07-16-2024 15:08   cvasl/vendor/comscan/comscan_environment.yml
      810  07-31-2024 11:24   cvasl/vendor/comscan/looser_comscan.yml
    57365  07-31-2024 11:24   cvasl/vendor/comscan/neurocombat.py
     4969  07-31-2024 11:24   cvasl/vendor/comscan/nifti.py
    12533  07-31-2024 11:24   cvasl/vendor/comscan/utils.py
     2487  06-18-2024 09:42   cvasl/vendor/covbat/README.md
    13566  06-18-2024 09:42   cvasl/vendor/covbat/covbat.py
      389  06-18-2024 09:42   cvasl/vendor/covbat/covbat_environment.yml
     1089  06-18-2024 09:42   cvasl/vendor/neurocombat/LICENSE
     2892  06-18-2024 09:42   cvasl/vendor/neurocombat/README.md
       24  06-18-2024 09:42   cvasl/vendor/neurocombat/__init__.py
    18724  06-18-2024 09:42   cvasl/vendor/neurocombat/neurocombat.py
     1069  06-18-2024 09:42   cvasl/vendor/open_nested_combat/LICENSE
     1400  06-18-2024 09:42   cvasl/vendor/open_nested_combat/README.md
       24  06-18-2024 09:42   cvasl/vendor/open_nested_combat/__init__.py
    11082  06-18-2024 09:42   cvasl/vendor/open_nested_combat/nest.py
      124  06-18-2024 09:42   cvasl/vendor/open_nested_combat/requirements.txt
    11376  07-31-2024 15:32   cvasl-0.0.4.dev28+geba2ba7.d20240731.dist-info/LICENSE
    11440  07-31-2024 15:32   cvasl-0.0.4.dev28+geba2ba7.d20240731.dist-info/METADATA
      394  07-31-2024 15:32   cvasl-0.0.4.dev28+geba2ba7.d20240731.dist-info/NOTICE.md
       91  07-31-2024 15:32   cvasl-0.0.4.dev28+geba2ba7.d20240731.dist-info/WHEEL
        6  07-31-2024 15:32   cvasl-0.0.4.dev28+geba2ba7.d20240731.dist-info/top_level.txt
     4446  07-31-2024 15:32   cvasl-0.0.4.dev28+geba2ba7.d20240731.dist-info/RECORD
---------                     -------
   332067                     50 files
suvayu commented 2 months ago

I guess I should exclude the notebooks, and yaml files?

egpbos commented 2 months ago

Looking great so far!

The doc building should be minor, the workflow is still trying to run setup.py, so just replace that with a default sphinx build command, see e.g. the template workflow: https://github.com/NLeSC/python-template/blob/main/%7B%7Bcookiecutter.directory_name%7D%7D/.github/workflows/documentation.yml To copy-paste (almost) that whole workflow, you also need to add a doc group under [project.optional-dependencies], see here.

Btw, I think the conda package wasn't built for a while already, so not sure whether that stuff is still necessary, but were you planning on porting that still as well? If not, we can always do it later, probably not a priority right now.

suvayu commented 1 month ago

I'm a bit confused & unsure about the mixed conda + pip setup. Conda doesn't respect pyproject.toml at all. And to generate the docs, building and installing with (build) and pip seems to work.

This mixed setup leads to a lot of duplication of dependency specification; environment.yml, pyproject.toml, workflow yamls.

suvayu commented 1 month ago

cvasl.vendor.rst:document isn't included in any toctree

@drcandacemakedamoore do you want to generate the docs for the vendored libraries as well? I'm inclined towards yes, since they are not really maintained upstream.

suvayu commented 1 month ago

Warning, treated as error: /home/runner/work/cvasl/cvasl/cvasl/vendor/comscan/clustering.py:docstring of sklearn.utils._metadata_requests.RequestMethod.get..func:3:undefined label: 'metadata_routing' [ref.ref]

Ok docs build except for this really odd error. I could only find one import from sklearn.utils: https://github.com/brainspinner/cvasl/blob/24e44e70373de04f341353c74b0c3a874c175080/cvasl/vendor/comscan/neurocombat.py#L27

and it is not even referenced in any docstring (I was expecting something like :ref:<imported-name>).

egpbos commented 1 month ago

Can you ignore imports (or just that one) in the docs config?

brainspinner commented 3 weeks ago

In the pyproject toml you set Python to 3.10, but then in github actions you use 3.11, I don't think 3.10 will work, but I will try to run some checks later

Never mind about this....