Skip to content
Merged
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
71 changes: 51 additions & 20 deletions .github/workflows/release-build.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,66 @@
name: Release workflow - Build and Publish Package
# This workflow will upload a Python Package to PyPI when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

name: Upload Python Package

on:
push:
branches:
- main
paths:
- 'version.py' # Only run when the version is bumped
release:
types: [published]

permissions:
contents: read

jobs:
build-and-publish:
runs-on: ubuntu-22.04
permissions:
id-token: write
contents: read
release-build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch sufficient history for setuptools-scm to find tags
# Using 50 commits should cover most scenarios while being faster than full history
fetch-depth: 50

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.12'
python-version: "3.12"

- name: Install dependencies
- name: Build release distributions
run: |
python -m pip install --upgrade pip
python -m pip install setuptools wheel twine
python -m pip install build
python -m build

- name: Build package
run: |
python setup.py sdist bdist_wheel
- name: Upload distributions
uses: actions/upload-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish package to PyPI
pypi-publish:
runs-on: ubuntu-latest
needs:
- release-build
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write

# Dedicated environments with protections for publishing are strongly recommended.
# For more information, see: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#deployment-protection-rules
environment:
name: pypi
# PyPI project URL
url: https://pypi.org/project/oscar-python/${{ github.event.release.name }}

steps:
- name: Retrieve release distributions
uses: actions/download-artifact@v4
with:
name: release-dists
path: dist/

- name: Publish release distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist/
119 changes: 0 additions & 119 deletions .github/workflows/release-version.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: tests

on:
push:
branches: ["main"]
branches: ["main", "devel"]
pull_request:
branches: ["main"]
branches: ["main", "devel"]

jobs:
test:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## Python OSCAR client

[![Build](https://github.com/grycap/oscar_python/actions/workflows/release-build.yaml/badge.svg)](https://github.com/grycap/oscar_python/actions/workflows/release-build.yaml)
![PyPI](https://img.shields.io/pypi/v/oscar_python)
[![Tests](https://github.com/grycap/oscar_python/actions/workflows/tests.yaml/badge.svg?branch=main)](https://github.com/grycap/oscar_python/actions/workflows/tests.yaml)
[![PyPI](https://img.shields.io/pypi/v/oscar-python)](https://pypi.org/project/oscar-python/)

This package provides a client to interact with OSCAR (https://oscar.grycap.net) clusters and services. It is available on Pypi with the name [oscar-python](https://pypi.org/project/oscar-python/).

Expand Down
35 changes: 35 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[build-system]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "oscar-python"
dynamic = ["version"]
description = "Python client for OSCAR clusters"
readme = "README.md"
requires-python = ">=3.8"
license = {text = "Apache-2.0"}
authors = [{name = "GRyCAP - I3M - UPV"}]
keywords = ["oscar", "faas", "serverless"]

dependencies = [
"requests>=2.31.0",
"webdavclient3>=3.14.6",
"boto3>=1.28.0",
"pyyaml>=6.0",
"aiohttp>=3.9.0",
"liboidcagent>=1.0.0",
]

[project.optional-dependencies]
dev = [
"pytest>=7.4.0",
"pytest-cov>=4.1.0",
]

[project.urls]
Homepage = "https://github.com/grycap/oscar-python"
Repository = "https://github.com/grycap/oscar-python"

[tool.setuptools_scm]
# Automatically get version from git tags
38 changes: 5 additions & 33 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,38 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from setuptools import setup, find_namespace_packages
"""Minimal setup.py for backward compatibility.
All configuration is now in pyproject.toml.
"""

# Load readme
with open('README.md', mode='r', encoding='utf-8') as f:
readme = f.read()
from setuptools import setup

# Load version
with open('version.py', mode='r', encoding='utf-8') as f:
exec(f.read())


setup(name='oscar_python',
version=__version__,
description='OSCAR API for python',
long_description=readme,
long_description_content_type='text/markdown',
url='https://github.com/grycap/oscar_python',
author='GRyCAP - Universitat Politecnica de Valencia',
author_email='[email protected]',
license='Apache 2.0',
packages=find_namespace_packages(),
install_requires=[
'webdavclient3 == 3.14.6',
'requests',
'boto3',
'setuptools >= 40.8.0',
'pyyaml',
'aiohttp',
'liboidcagent',
],
classifiers=[
'Programming Language :: Python :: 3',
'License :: OSI Approved :: Apache Software License'
],
zip_safe=False)
setup()