Skip to content

Commit

Permalink
Misc fixes (#2)
Browse files Browse the repository at this point in the history
Github Actions badge in README.md
Github Actions on for push and PR to master
Version string in a single location
  • Loading branch information
matthewrmshin authored and MatthewHambley committed Dec 17, 2019
1 parent 940ba3e commit f6c645b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Python package

on: [push]
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
![](https://github.com/MetOffice/stylist/workflows/Python%20package/badge.svg)

# Stylist

The immediate need was for a code style checking tool which understood Fortran.
Expand Down
20 changes: 13 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
"""Setup Stylist for distribution on PyPI."""

from ast import literal_eval
import os
from setuptools import setup, find_packages

# Get the long description from the README file
HERE = os.path.dirname(__file__)
with open(os.path.join(HERE, 'README.md'), encoding='utf-8',) as handle:
LONG_DESCRIPTION = handle.read()
with open(
os.path.join(os.path.dirname(__file__), 'README.md'),
os.path.join(HERE, 'source', 'stylist', '__init__.py'),
encoding='utf-8',
) as handle:
LONG_DESCRIPTION = handle.read()
for line in handle:
items = line.split('=', 1)
if items[0].strip() == '__version__':
VERSION = literal_eval(items[1].strip())
break
else:
raise RuntimeError('Cannot determine package version.')

setup(
name='stylist',
# TODO:
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.1',
version=VERSION,
description=(
'Extensible code style checker'
' currently supporting Fortran, PSyclone DSL, etc'
Expand Down
5 changes: 5 additions & 0 deletions source/stylist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
# The file LICENCE, distributed with this code, contains details of the terms
# under which the code may be used.
##############################################################################
'''
Extensible code style checker currently supporting Fortran, PSyclone DSL, etc
'''

__version__ = '0.1'

0 comments on commit f6c645b

Please sign in to comment.