-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Directory restructure for PyPI readiness (#1)
* Directory restructure for PyPI readiness Add meta files for PyPI readiness. Move projects into `src/` to model after PyPA sample project. Move script to `src/stylist/__main__.py`. Add basic Github action to run linter and test. * Happiness for flake8 and pytest Remove Python 2 compat. Minor syntax update to satisfy flake8 and pytest. * Test all supported versions Also include coverage. * Fix pytest coverage syntax Use package name instead of src. Fail if coverage less than 75%. * Remove unnecessary __main__ test Already in __main__.py module! * Update description for package * src -> source This is preferred by the reviewer.
- Loading branch information
1 parent
b6815a6
commit 940ba3e
Showing
16 changed files
with
124 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Python package | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 3 | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
pip install -e . | ||
- name: Lint with flake8 | ||
run: | | ||
pip install -e .[dev] | ||
flake8 . --count --show-source --statistics | ||
- name: Test with pytest | ||
run: | | ||
pip install .[test] | ||
pytest --cov stylist --cov-fail-under=75 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Include the README | ||
include *.md | ||
|
||
# Include the license file | ||
include LICENSE | ||
|
||
# Include the documentation files | ||
recursive-include documentation * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[metadata] | ||
license_files = LICENSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
"""Setup Stylist for distribution on PyPI.""" | ||
|
||
import os | ||
from setuptools import setup, find_packages | ||
|
||
# Get the long description from the README file | ||
with open( | ||
os.path.join(os.path.dirname(__file__), 'README.md'), | ||
encoding='utf-8', | ||
) as handle: | ||
LONG_DESCRIPTION = handle.read() | ||
|
||
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', | ||
description=( | ||
'Extensible code style checker' | ||
' currently supporting Fortran, PSyclone DSL, etc' | ||
), | ||
long_description=LONG_DESCRIPTION, | ||
long_description_content_type='text/markdown', | ||
url='https://github.com/MetOffice/stylist', | ||
author='Met Office', | ||
classifiers=[ | ||
'Development Status :: 3 - Alpha', | ||
'Intended Audience :: Developers', | ||
'Topic :: Software Development :: Quality Assurance', | ||
'License :: OSI Approved :: BSD License', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
], | ||
keywords='linter fortran psyclone', | ||
package_dir={'': 'source'}, | ||
packages=find_packages(where='source'), | ||
python_requires='>=3.6, <4', | ||
install_requires=['fparser'], | ||
extras_require={ | ||
'dev': ['check-manifest', 'flake8'], | ||
'test': ['pytest', 'pytest-cov'], | ||
}, | ||
entry_points={ | ||
'console_scripts': ['stylist=stylist.__main__:main'], | ||
}, | ||
project_urls={ | ||
'Bug Reports': 'https://github.com/MetOffice/stylist/issues', | ||
'Source': 'https://github.com/MetOffice/stylist/', | ||
}, | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters