Skip to content

Commit

Permalink
Merge pull request #143 from nansencenter/update_packaging
Browse files Browse the repository at this point in the history
Use build as packaging frontend
  • Loading branch information
aperrin66 authored May 24, 2024
2 parents beb00f1 + 73d17f1 commit 77de6b7
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 54 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ jobs:
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
METANORM_VERSION=${{ env.METANORM_VERSION }}
GEOSPAAS_HARVESTING_RELEASE=${{ github.ref_type == 'tag' && github.ref_name || '0.0.0' }}
push: ${{ github.event_name == 'release' }}
tags: |
${{ env.IMAGE_NAME }}:${{ github.ref_name }}-python${{ matrix.python_version }}
Expand Down Expand Up @@ -141,9 +140,8 @@ jobs:
run: >
docker run --rm
-v "$(pwd):/src"
-e "GEOSPAAS_HARVESTING_RELEASE=${{ github.ref_name }}"
"${{ vars.DOCKER_ORG }}/geospaas:latest"
python setup.py sdist bdist_wheel
bash -c "pip install build && python -m build"
- name: 'Deploy package to the Github release'
env:
Expand Down
13 changes: 4 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ RUN pip install --upgrade --no-cache-dir \

FROM base

ARG GEOSPAAS_HARVESTING_RELEASE='0.0.0dev'
WORKDIR /tmp/setup
COPY setup.py README.md ./
COPY geospaas_harvesting ./geospaas_harvesting
RUN python setup.py bdist_wheel && \
pip install -v dist/geospaas_harvesting-*.whl && \
cd .. && rm -rf setup/
WORKDIR /
COPY . /tmp/setup
RUN pip install /tmp/setup && \
rm -rf /tmp/setup

ENTRYPOINT ["python"]
CMD ["-m", "geospaas_harvesting.harvest"]
CMD ["-m", "geospaas_harvesting.cli"]
40 changes: 40 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[build-system]
requires = ["setuptools", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[project]
name = "geospaas_harvesting"
description = "Metadata harvesting tool for GeoSPaaS"
readme = "README.md"
authors = [{name = "Adrien Perrin", email = "[email protected]"}]
license = {file = "LICENSE"}
classifiers = [
"Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: POSIX :: Linux",
]
requires-python = ">=3.7"
dependencies = [
"django-geo-spaas",
"django",
"feedparser",
"graypy",
"metanorm",
"nansat",
"netCDF4",
"numpy",
"oauthlib",
"pythesint",
"python-dateutil",
"PyYAML",
"requests_oauthlib",
"requests",
"shapely",
]
urls = {Repository = "https://github.com/nansencenter/django-geo-spaas-harvesting"}
dynamic = ["version"]

[tool.setuptools]
packages = ["geospaas_harvesting"]
42 changes: 0 additions & 42 deletions setup.py

This file was deleted.

0 comments on commit 77de6b7

Please sign in to comment.