Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some packaging improvements #3

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/run-tests.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Black magic. What exactly is the nightly test doing? Just testing it builds ok?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it builds the environment, installs the tool, then it checks a basic s3view --help and which s3view - of course, this will contain at least a pytest -n 2 as soon as unit/integration tests become available

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

name: Test

on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: '0 0 * * *' # nightly

# Required shell entrypoint to have properly configured bash shell
defaults:
run:
shell: bash -l {0}

jobs:
linux:
runs-on: "ubuntu-latest"
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
fail-fast: false
name: Linux Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: s3view
environment-file: environment.yml
python-version: ${{ matrix.python-version }}
miniforge-version: "latest"
miniforge-variant: Mambaforge
use-mamba: true
- run: conda --version
- run: python -V
- run: conda list
- run: pip install -e .
- run: conda list
- run: which s3view
- run: s3view --help
# turn these on when they will be needed
# - run: flake8
# - run: pytest -n 2
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
s3v.egg-info
s3v/__pycache__
11 changes: 11 additions & 0 deletions environment.yml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd quite like to put dependencies on particular branches (for now), that I'd do like this with pip:
pip install git+https://github.com/davidhassell/cfdm.git@h5-read-hdf5-chunks-hack, how would we do that?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is how it's done: here, with the main branch of the main repo, change as you like 3d11bf4

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nay bother, did that for you in last commit a8f1611

Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
name: s3view
channels:
- conda-forge
- nodefaults

dependencies:
- cmd2 >1
- cf-python >=3.16.2 # 3.17.0 n/a yet on conda-forge
- minio
- python >=3.10
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
scripts=['s3v/s3view'],
install_requires = [
'cmd2>2',
'cf-python>=3.16.2', # 3.17 n/a yet on PyPI
'minio',
'pyreadline3;platform_system=="Windows"'
]
)
)