Skip to content

Commit

Permalink
Add basic package structure
Browse files Browse the repository at this point in the history
  • Loading branch information
dekuenstle committed Sep 9, 2020
1 parent 23045fd commit 2e207c1
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 5 deletions.
14 changes: 14 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[run]
cover_pylib = false
omit =
*/site-packages/*
*/tests/*

[report]
exclude_lines =
pragma: no cover
def __repr__
RuntimeError
NotImplementedError
FileNotFoundError
ImportError
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[flake8]
max-line-length = 127
exclude = .git,__pycache__,doc/,docs/,build/,dist/,archive/
per-file-ignores =
__init__.py:F401
9 changes: 4 additions & 5 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,19 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
- name: Install package with dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
pip install -e .[bridge, tests, docs]
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
flake8 . --count --exit-zero --max-complexity=10 --statistics
- name: Test with pytest and measure coverage
run: |
pytest --cov=./ --cov-report=xml
pytest --cov --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
6 changes: 6 additions & 0 deletions .mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[mypy]
ignore_missing_imports = True
strict_optional = False
allow_redefinition = True
show_error_context = False
show_column_numbers = True
3 changes: 3 additions & 0 deletions ordcomp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from ._version import __version__

__all__ = ['__version__']
1 change: 1 addition & 0 deletions ordcomp/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.0"
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[build-system]
requires = ["setuptools", "wheel"]

[tool.pytest.ini_options]
addopts = "--doctest-modules -ra -v"
51 changes: 51 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Static configuration of the distribution package, as defined by setuptools
[metadata]
name = ordcomp
description = Machine Learning Toolkit for Ordinal Comparison in Python.
long_description = file: README.md, LICENSE
author = 'David-Elias Künstle'
author_email = 'david-elias dot kuenstle at uni-tuebingen dot de'
url = 'https://github.com/dekuenstle/ordcomp'
classifierts =
Development Status :: 1 - Planning
Environment :: GPU :: NVIDIA CUDA
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)
Programming Language :: Python
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: Microsoft :: Windows
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Typing :: Typed
description-file = README.md
license_files = LICENSE

[options]
python_requires = >=3.7
packages = find:
zip_safe = False
install_requires =
numpy
scipy
scikit-learn

[options.extras_require]
bridge =
rpy2
oct2py
tests =
pytest
pytest-cov
flake8
mypy
docs =
sphinx
sphinx-gallery
sphinx_rtd_theme
numpydoc
matplotlib
13 changes: 13 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /usr/bin/env python
""" Dynamic configuration of distribution package. """

import os

from setuptools import find_packages, setup

# get __version__ from _version.py
ver_file = os.path.join('ordcomp', '_version.py')
with open(ver_file) as f:
exec(f.read())

setup(version=__version__)

0 comments on commit 2e207c1

Please sign in to comment.