Fix smoke workflow — Python 3.11 + actually validate pyproject.toml #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: smoke | |
| on: | |
| push: | |
| branches: [master, main] | |
| pull_request: | |
| branches: [master, main] | |
| jobs: | |
| import-and-package: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install package (editable) | |
| run: | | |
| python -m pip install --upgrade pip | |
| # Install only the dependencies the smoke test exercises (torch, transformers, | |
| # tokenizers, biopython, etc. are pulled in by the package's full | |
| # requirements but are not needed to verify import/structure). | |
| pip install -e . --no-deps | |
| pip install torch --index-url https://download.pytorch.org/whl/cpu | |
| pip install transformers tokenizers numpy pandas tqdm | |
| - name: Import the craft package | |
| run: | | |
| python -c "import craft; print('craft', craft.__version__)" | |
| python -c "from craft.datasets import GeneDatasetTrain, GeneDatasetInference, GeneDatasetPerplexity" | |
| python -c "from craft.model import GeneBARTModelComposite, GeneBARTModelSingleHead, AttentionPooling" | |
| - name: Verify CITATION.cff parses | |
| run: | | |
| pip install cffconvert | |
| cffconvert --validate | |
| - name: Verify pyproject.toml is valid | |
| run: | | |
| pip install validate-pyproject[all] | |
| validate-pyproject pyproject.toml | |
| python -c " | |
| import tomllib | |
| with open('pyproject.toml','rb') as f: data=tomllib.load(f) | |
| print('pyproject project:', data['project']['name'], data['project']['version']) | |
| " |