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

Feature 22 - Add python packages for geolake drivers #23

Open
wants to merge 4 commits into
base: release_0.1.1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ jobs:
python-version: ["3.11"]
os: [ubuntu-latest]
permissions:
id-token: write
contents: read
id-token: write
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -30,4 +31,4 @@ jobs:
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./client/dist
repository-url: https://test.pypi.org/legacy/
repository-url: https://test.pypi.org/legacy/
33 changes: 33 additions & 0 deletions .github/workflows/publish_drivers_on_testpypi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build geolake drivers and publish to TestPyPi

on:
pull_request:
types: [opened, synchronize]
workflow_dispatch:
jobs:
drivers-build-and-publish:
name: Build geolake drivers and publish to TestPyPI
strategy:
matrix:
python-version: ["3.11"]
os: [ubuntu-latest]
permissions:
id-token: write
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install build tool
working-directory: ./drivers
run: python3 -m pip install build --user .
- name: Build wheels
working-directory: ./drivers
run: python -m build --sdist --wheel --outdir=dist/ .
- name: Publish package distributions to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: ./drivers/dist
repository-url: https://test.pypi.org/legacy/
6 changes: 3 additions & 3 deletions drivers/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ ARG TAG=v0.2.6b2
FROM $REGISTRY/geokube:$TAG
RUN conda install -c conda-forge --yes --freeze-installed intake=0.6.6
RUN conda clean -afy
COPY dist/intake_geokube-0.1a0-py3-none-any.whl /
RUN pip install /intake_geokube-0.1a0-py3-none-any.whl
RUN rm /intake_geokube-0.1a0-py3-none-any.whl
COPY dist/geolake_drivers-0.1.0b0-py3-none-any.whl /
RUN pip install /geolake_drivers-0.1.0b0-py3-none-any.whl
RUN rm /geolake_drivers-0.1.0b0-py3-none-any.whl
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ def _prepare_df_from_files(files: Iterable[str], pattern: str) -> pd.DataFrame:
return pd.DataFrame(data)


class CMCCSentinelSource(GeokubeSource):
name = "cmcc_sentinel_geokube"
version = "0.0.1"
class SentinelSource(GeokubeSource):
name = "sentinel"
version = "0.1.0"

def __init__(
self,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def preprocess_wrf(dset: xr.Dataset, **kwargs) -> xr.Dataset:
return dset


class CMCCWRFSource(GeokubeSource):
name = "cmcc_wrf_geokube"
class WRFSource(GeokubeSource):
name = "wrf"

def __init__(
self,
Expand Down Expand Up @@ -143,7 +143,7 @@ def __init__(
variables_to_skip=variables_to_skip,
)
# self.xarray_kwargs.update({'engine' : 'netcdf'})
super(CMCCWRFSource, self).__init__(metadata=metadata, **kwargs)
super(WRFSource, self).__init__(metadata=metadata, **kwargs)

def _open_dataset(self):
if self.pattern is None:
Expand Down
22 changes: 11 additions & 11 deletions drivers/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,32 @@
long_description = f.read()

setuptools.setup(
name="intake-geokube",
version="0.1a0",
author="CMCC Foundation - PPOS Research Group",
author_email="[email protected]",
description="Geokube driver for Intake.",
name="geolake-drivers",
version="0.1.0b0",
author="geolake Contributors",
author_email="[email protected]",
description="intake-based drivers for geolake",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/geokube/intake-geokube",
url="https://github.com/CMCC-Foundation/geolake/drivers",
packages=setuptools.find_packages(),
install_requires=["intake", "pytest", "pydantic<2.0.0"],
entry_points={
"intake.drivers": [
"geokube_netcdf = intake_geokube.netcdf:NetCDFSource",
"cmcc_wrf_geokube = intake_geokube.wrf:CMCCWRFSource",
"cmcc_sentinel_geokube = intake_geokube.sentinel:CMCCSentinelSource"
"netcdf = geolake_drivers.netcdf:NetCDFSource",
"wrf = geolake_drivers.wrf:WRFSource",
"sentinel = geolake_drivers.sentinel:SentinelSource"
]
},
classifiers=[
"Development Status :: 3 - Alpha",
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Atmospheric Science",
"Topic :: Scientific/Engineering",
],
python_requires=">=3.8",
license="Apache License, Version 2.0",
Expand Down
Loading