Skip to content

Commit

Permalink
Set up for PyPi deployment.
Browse files Browse the repository at this point in the history
  • Loading branch information
tymorrow committed Jul 7, 2021
1 parent e7ebbad commit 008905a
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 12 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish Python 🐍 distributions 📦 to PyPI and TestPyPI
on:
release:
types: [published]
jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@master
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
continue-on-error: true
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,17 @@ This repository contains core functions and classes used by the BALDR project (B

## Prerequisites

- Python 3.7+
- Python 3.7

## Installation

This section will assume you have:

- installed Python 3.7 or higher; and
- cloned this repo

With the above done, perform the following:

```
pip install <path to repository>
pip install riid
```

### Data Directory (optional)

Some functions are usable only if you set the `PYRIID_DATA_DIR` environment variable to a path to some directory on your computer.
Some *convenience* functions are usable only if you set the `PYRIID_DATA_DIR` environment variable to a path to some directory on your computer.

## Examples

Expand All @@ -48,8 +41,13 @@ Please make sure to update tests as appropriate and adhere to our [code of condu

## Authors

Current:

- **Tyler Morrow** - [email protected]
- **Nathan Price** - [email protected]

Past:

- [Travis McGuire](https://github.com/traviemcg)
- Original creator of the `PoissonBayes` model.

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
35 changes: 33 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
# Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
# Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government retains certain rights in this software.
"""Simple setup script for installing the core package.
"""
from setuptools import setup, find_packages
import platform
import sys

from setuptools import find_packages, setup

python_version_min = (3, 7, 0)
python_version_max = (3, 7, 11)
required_python_version_str = '.'.join(map(str, python_version_min[:2]))
if python_version_min < sys.version_info > python_version_max:
print("You are using Python {}. Python =={} is required.".format(platform.python_version(),
required_python_version_str))
sys.exit(-1)

setup(
name="riid",
version="1.0.0",
description="Machine learning-based models and utilities for radioisotope identification",
author="Tyler Morrow,Nathan Price",
author_email="[email protected],[email protected]",
url="https://www.sandia.gov",
url="https://github.com/sandialabs/PyRIID",
packages=find_packages(),
install_requires=[
"tensorflow==2.0.0",
Expand All @@ -21,4 +34,22 @@
"tqdm",
"seaborn==0.10.1"
],
# PyPI package information.
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.7'
],
license='BSD-3',
keywords='pyriid riid machine learning',
)

0 comments on commit 008905a

Please sign in to comment.