Skip to content

Commit

Permalink
use build instead of setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aperrin66 authored and akorosov committed May 24, 2024
1 parent 617bdaa commit f13282e
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 64 deletions.
23 changes: 16 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ jobs:
context: .
build-args: |
BASE_IMAGE=${{ env.BASE_IMAGE }}
DJANGO_GEO_SPAAS_RELEASE=${{ github.ref_type == 'tag' && github.ref_name || '0.0.0' }}
push: ${{ github.ref_type == 'tag' }}
tags: |
${{ env.IMAGE_NAME }}:${{ github.ref_name }}-python${{ matrix.python_version }}
Expand All @@ -110,7 +109,7 @@ jobs:
publish_python_package:
name: Publish the Python package to PyPI
name: Publish the Python package
runs-on: 'ubuntu-latest'
needs: 'tests_and_docker_build'
if: github.event_name == 'release'
Expand All @@ -124,12 +123,22 @@ jobs:
python-version: 3.11

- name: Build package
run: >
DJANGO_GEO_SPAAS_RELEASE="${{ github.ref_name }}"
python setup.py sdist
shell: bash
run: |
pip install build
python -m build
- name: 'Deploy package to the Github release'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: 'dist/*'
file_glob: true
tag: ${{ github.ref }}

- name: Publish
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository_url: ${{ vars.PYPI_REPOSITORY_URL }}
Expand Down
10 changes: 3 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,9 @@ RUN apt update \

FROM base as full

ARG DJANGO_GEO_SPAAS_RELEASE '0.0.0dev'
# install Geo-SPaaS
COPY geospaas /tmp/geospaas
COPY setup.py /tmp/
COPY MANIFEST.in /tmp/
WORKDIR /tmp
RUN pip install . \
&& rm -r geospaas setup.py MANIFEST.in
COPY . /tmp/geospaas/
RUN pip install /tmp/geospaas && \
rm -rf /tmp/geospaas

WORKDIR /src
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[build-system]
requires = ["setuptools", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[tool.setuptools_scm]

[project]
name = "django-geo-spaas"
description = "Tools to manage geospatial datasets"
readme = "README.md"
authors = [
{name = "Morten W. Hansen"},
{name = "Anton A. Korosov", email="[email protected]"},
{name = "Artem Moiseev"},
{name = "Jeong-Won Park"},
{name = "Adrien Perrin"},
{name = "Arash Azamifard"},
]
license = {file = "LICENSE"}
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Utilities",
]
dependencies = [
"django-forms-bootstrap",
"django-leaflet",
"django<4",
"gdal",
"nansat",
"netCDF4",
"pythesint",
]
urls = {Repository = "https://github.com/nansencenter/django-geo-spaas"}
dynamic = ["version"]

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

This file was deleted.

0 comments on commit f13282e

Please sign in to comment.