diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ea677d3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,24 @@ +name: Build Test + +on: + pull_request: + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install build + run: python -m pip install build + + - name: Build package + run: python -m build diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..9f39a94 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,52 @@ +name: Publish to PyPI + +on: + push: + tags: + - "v*" + +jobs: + build: + name: Build distribution + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.x" + + - name: Install build + run: python -m pip install build + + - name: Build package + run: python -m build + + - name: Upload distribution artifacts + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + + publish: + name: Publish to PyPI + needs: build + runs-on: ubuntu-latest + environment: + name: pypi + url: https://pypi.org/p/condorpy + permissions: + contents: read + id-token: write + steps: + - name: Download distribution artifacts + uses: actions/download-artifact@v4 + with: + name: dist + path: dist/ + + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.travis.yml b/.travis.yml index b096836..503fa96 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,7 +47,7 @@ install: - conda create -q -n test-environment python=$TRAVIS_PYTHON_VERSION scp paramiko - source activate test-environment - - python setup.py install + - pip install . - pip install coverage coveralls # command to run tests diff --git a/README.rst b/README.rst index fe17883..33cf0b5 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ CondorPy ======== :condorpy: Python interface for high throughput computing with HTCondor -:Version: 0.6.0 +:Version: see latest tag :Author: Scott Christensen :Team: Tethys Platform :Homepage: http://tethysplatform.org/condorpy/ diff --git a/docs/source/index.rst b/docs/source/index.rst index 15dc5a5..d2d62ea 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -37,7 +37,7 @@ Installing from Source ====================== :: - $ python setup.py install + $ pip install . Getting Started diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..34a57f6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,23 @@ +[build-system] +requires = ["setuptools>=64", "setuptools-scm>=8"] +build-backend = "setuptools.build_meta" + +[project] +name = "condorpy" +dynamic = ["version"] +description = "A Python wrapper for HTCondor's cli" +readme = "README.rst" +license = { text = "BSD 2-Clause License" } +authors = [ + { name = "Scott Christensen", email = "sdc50@byu.net" }, +] +keywords = ["htcondor", "distributed-computing", "job-scheduling"] +dependencies = ["scp", "paramiko"] + +[project.urls] +Homepage = "http://tethysplatform.org/condorpy/" + +[tool.setuptools.packages.find] +where = ["."] + +[tool.setuptools_scm] diff --git a/setup.py b/setup.py deleted file mode 100644 index f2dbb25..0000000 --- a/setup.py +++ /dev/null @@ -1,49 +0,0 @@ -# Copyright (c) 2015 Scott Christensen -# -# This file is part of condorpy -# -# condorpy is free software: you can redistribute it and/or modify it under -# the terms of the BSD 2-Clause License. A copy of the BSD 2-Clause License -# should have been distributed with this file. - -from setuptools import setup, find_packages -import os, re - -with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: - README = readme.read() - -# allow setup.py to be run from any path -os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) - -VERSION = re.search(':Version: ([\.?\d]*)', README).group(1) - -setup( - name="condorpy", - version=VERSION, - packages=find_packages(), - #scripts=['say_hello.py'], - - # Project uses reStructuredText, so ensure that the docutils get - # installed or upgraded on the target machine - install_requires=['scp', 'paramiko'], - - -# package_data = { -# # If any package contains *.txt or *.rst files, include them: -# '': ['*.txt', '*.rst'], -# # And include any *.msg files found in the 'hello' package, too: -# 'hello': ['*.msg'], -# }, - - - # metadata for upload to PyPI - author="Scott Christensen", - author_email="sdc50@byu.net", - description="A Python wrapper for HTCondor's cli", - long_description=README, - license="BSD 2-Clause License", - keywords="htcondor distributed-computing job-scheduling", - url="http://tethysplatform.org/condorpy/", - - # could also include download_url, classifiers, etc. -) \ No newline at end of file