Skip to content

Commit

Permalink
Merge pull request #58 from jGaboardi/release_prep
Browse files Browse the repository at this point in the history
Release prep & action
  • Loading branch information
jGaboardi committed Jan 21, 2021
2 parents 762d844 + c886e6d commit 10ecc84
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 32 deletions.
File renamed without changes.
File renamed without changes.
68 changes: 68 additions & 0 deletions .github/workflows/release_and_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Release package on GitHub and publish to PyPI
# IMPORTANT
# * create a git tagged release
# * push git tagged release to upstream (if upstream exists)
#--------------------------------------------------
name: release_and_publish

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine jupyter urllib3 pandas pyyaml
python setup.py sdist bdist_wheel
- name: Run Changelog
run: |
jupyter nbconvert --to notebook --execute --inplace --ExecutePreprocessor.timeout=-1 --ExecutePreprocessor.kernel_name=python3 tools/gitcount.ipynb
- name: Cat Changelog
uses: pCYSl5EDgo/cat@master
id: changetxt
with:
path: ./tools/changelog.md
env:
TEXT: ${{ steps.changetxt.outputs.text }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # token is provided by GHA, DO NOT create
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: ${{ steps.changetxt.outputs.text }}
draft: false
prerelease: false
- name: Get Asset name
run: |
export PKG=$(ls dist/)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: dist/${{ env.name }}
asset_name: ${{ env.name }}
asset_content_type: application/zip
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_PASSWORD }}
2 changes: 1 addition & 1 deletion .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
strategy:
matrix:
os: ['macos-latest', 'ubuntu-latest', 'windows-latest']
environment-file: [ci/37.yaml, ci/38.yaml, ci/39.yaml]
environment-file: [.ci/38.yaml, .ci/39.yaml]
defaults:
run:
shell: bash -l {0}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ TigerNet is a Python library that addresses concerns in topology and builds accu

## Installation

Currently `tigernet` officially supports [3.7](https://docs.python.org/3.7/), [3.8](https://docs.python.org/3.8/), and [3.9](https://docs.python.org/3.9/). Please make sure that you are operating in a Python >= 3.7 environment. Install the most current development version of `tigernet` by running:
Currently `tigernet` officially supports [3.8](https://docs.python.org/3.8/) and [3.9](https://docs.python.org/3.9/). Please make sure that you are operating in a Python >= 3.8 environment. Install the most current development version of `tigernet` by running:

```
$ pip install git+https://github.com/jGaboardi/tigernet
Expand Down
16 changes: 0 additions & 16 deletions ci/37.yaml

This file was deleted.

16 changes: 3 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,8 @@
from distutils.command.build_py import build_py
from setuptools import setup
import sys
from setuptools import setup, find_packages

package = "tigernet"

# This check resolves conda-forge build failures
# See the link below for original solution
# https://github.com/pydata/xarray/pull/2643/files#diff-2eeaed663bd0d25b7e608891384b7298R29-R30
needs_pytest = {"pytest", "test", "ptr"}.intersection(sys.argv)
setup_requires = ["pytest-runner"] if needs_pytest else []

# Get __version__ from package/__init__.py
with open(package + "/__init__.py", "r") as f:
exec(f.readline())
Expand Down Expand Up @@ -63,8 +56,6 @@ def setup_package():
download_url="https://pypi.org/project/" + package,
maintainer="James D. Gaboardi",
maintainer_email="jgaboardi@gmail.com",
setup_requires=setup_requires,
tests_require=["pytest"],
keywords="network-topology, tiger-line, python, graph-theory",
classifiers=[
"Development Status :: 4 - Beta",
Expand All @@ -75,17 +66,16 @@ def setup_package():
"Topic :: Scientific/Engineering :: GIS",
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
],
license="3-Clause BSD",
packages=[package],
packages=find_packages(),
py_modules=[package],
install_requires=reqs,
zip_safe=False,
cmdclass={"build.py": build_py},
python_requires=">=3.7",
python_requires=">=3.8",
)


Expand Down
2 changes: 1 addition & 1 deletion tigernet/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "0.2.0"
__version__ = "0.2.1"

"""
`tigernet` --- "Network Topology via TIGER/Line Shapefiles"
Expand Down

0 comments on commit 10ecc84

Please sign in to comment.