Skip to content
Permalink
Browse files

Use flit and pyproject.toml

setup.py is remained for now.
  • Loading branch information...
JaeyeongYang committed Jan 8, 2019
1 parent 38ce1b5 commit 78e951c500bf3602a7035f6c15b2f07bc3bf62af
Showing with 168 additions and 22 deletions.
  1. +10 −0 MANIFEST.in
  2. +6 −1 Makefile
  3. +4 −1 Pipfile
  4. +65 −4 Pipfile.lock
  5. +22 −3 README.rst
  6. +1 −1 adopy/__init__.py
  7. +8 −0 adopy/functions/_const.py
  8. +33 −0 pyproject.toml
  9. +0 −6 requirements.txt
  10. +19 −6 setup.py
@@ -0,0 +1,10 @@
include LICENSE README.rst
include Makefile pyproject.toml
exclude .editorconfig .travis.yml Pipfile* setup.cfg

recursive-include docs *
recursive-include tests *.py
recursive-include examples *

prune docs/build

@@ -1,6 +1,11 @@
PIPENV_PATH = $(shell which pipenv)

init:
pip3 install pipenv
ifeq (, $(PIPENV_PATH))
pip install pipenv
endif
pipenv install --dev
pipenv run python -m flit install

test:
pipenv run py.test tests
@@ -8,9 +8,12 @@ autopep8 = "*"
flake8 = "*"
pylint = "*"
mypy = "*"

# For tests
pytest = "*"
pytest-cov = "*"
codecov = "*"

# For docs
sphinx = "*"
sphinx_rtd_theme = "*"
@@ -21,7 +24,7 @@ travis-sphinx = "*"
pandas = "*"
scipy = "*"
numpy = "*"
adopy = {editable = true,path = "."}
flit = "*"

[requires]
python_version = "3.5"

Some generated files are not rendered by default. Learn more.

@@ -31,7 +31,7 @@ Currently working in progress.
Dependencies
------------

- Python 2.7 or 3.5+
- Python 3.5+
- NumPy
- Pandas
- SciPy
@@ -47,5 +47,24 @@ Installation
# Set the working directory to the cloned repository.
cd adopy
# Install ADOpy with pip (Currently for development)
pip install -e .
# Install ADOpy with pip
pip install .
Development
-----------

You can set up a developmental environment using pipenv.

.. code-block:: bash
# Clone the repository from Github.
git clone https://github.com/JaeyeongYang/adopy.git
# Set the working directory to the cloned repository.
cd adopy
# Install dev dependencies with pipenv
pipenv install --dev
# Install adopy with flit with symlink
pipenv run flit install -e
@@ -15,4 +15,4 @@
__all__ = ['base', 'functions', 'tasks', 'Task', 'Model', 'Engine']

with open(os.path.join(os.path.dirname(__file__), 'VERSION'), 'r') as f:
__version__ = f.read()
__version__ = f.read().strip()
@@ -1,3 +1,11 @@
"""
Define functions for constraints on model parameters.
These constraints should be defined as named functions, since unnamed functions
like lambda cannot be serialized by pickle.
"""


def const_positive(x):
return x > 0

@@ -0,0 +1,33 @@
[build-system]
requires = ["flit"]
build-backend = "flit.buildapi"

[tool.flit.metadata]
module = "adopy"
dist-name = "ADOpy"
author = "Jaeyeong Yang"
author-email = "jaeyeong.yang1125@gmail.com"
home-page = "https://github.com/JaeyeongYang/adopy/"

requires = [
"numpy",
"pandas",
"scipy",
]
requires-python = ">=3.5"

description-file = "README.rst"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3 :: Only",
]

[tool.flit.metadata.urls]
Documentation = "https://jaeyeong-yang.com/adopy/"

This file was deleted.

@@ -6,28 +6,41 @@

# Get the long description from the relevant file
with codecs_open('README.rst', encoding='utf-8') as f:
long_description = f.read()
LONG_DESCRIPTION = f.read()

# Load the version
with open(os.path.join('adopy', 'VERSION'), 'r') as f:
version = f.read()
VERSION = f.read().strip()

setup(
name='adopy',
version=version,
url='https://github.com/JaeyeongYang/adopy',
version=VERSION,
description='',
long_description=long_description,
classifiers=[],
long_description=LONG_DESCRIPTION,
keywords='',

author='Jaeyeong Yang',
author_email='jaeyeong.yang1125@gmail.com',
url='https://github.com/JaeyeongYang/adopy',

license='GPL-3',
include_package_data=True,
zip_safe=False,

python_requires='>=3.5',
install_requires=[
'numpy',
'pandas',
'scipy',
],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', # noqa: E501
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3 :: Only',
],
)

0 comments on commit 78e951c

Please sign in to comment.
You can’t perform that action at this time.