Skip to content

Commit

Permalink
⚙️ Use setup.py instead of setup.json (#19)
Browse files Browse the repository at this point in the history
* 🔧 add deps to setup.py
* 💎 bump version to v2.0.0

Co-authored-by: Travis CI <[email protected]>
  • Loading branch information
juanesarango and Travis CI committed Sep 8, 2021
1 parent 84121cd commit 518557a
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 102 deletions.
27 changes: 0 additions & 27 deletions setup.json

This file was deleted.

51 changes: 31 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,43 @@
"""cookiecutter-toil setup.py."""

from os.path import join
from os.path import abspath
from os.path import dirname
import json

from setuptools import find_packages
from setuptools import setup

# make sure we use absolute paths
ROOT = abspath(dirname(__file__))

# please put setup keywords in the setup.json to keep this file clean
with open(join(ROOT, "setup.json"), "r") as f:
SETUP = json.load(f)

setup(
# the version is only defined in one place
version="1.0.0",

version="2.0.0",
# in combination with recursive-includes in MANIFEST.in, non-python files
# included inside the {{cookiecutter.project_slug}} will be copied to the
# site-packages installation directory
include_package_data=True,

# return a list all Python packages found within the ROOT directory
packages=find_packages(),

# pass parameters loaded from setup.json including author and version
**SETUP
)
# package-specific parameters
author="Juan S. Medina, Juan E. Arango",
classifiers=[
"License :: OSI Approved :: MIT License",
"Operating System :: Unix",
"Operating System :: POSIX",
"Topic :: Utilities",
],
install_requires=["cookiecutter>=1.7.3"],
setup_requires=["pytest-runner>=5.3.1"],
extras_require={
"test": [
"pytest-cov>=2.12.1",
"binaryornot>=0.4.4",
"pytest>=6.2.5",
"pytest-cookies>=0.6.1",
"tox>=3.24.3",
]
},
keywords=["cookiecutter", "toil"],
license="BSD",
name="cookiecutter-toil",
description="🍪 A cookiecutter for the creation of toil pipelines.",
long_description=(
"📘 learn more about this project on "
"[GitHub](https://github.com/papaemmelab/cookiecutter-toil)!"
),
long_description_content_type="text/markdown",
url="https://github.com/papaemmelab/cookiecutter-toil",
)
44 changes: 0 additions & 44 deletions {{cookiecutter.project_slug}}/setup.json

This file was deleted.

55 changes: 44 additions & 11 deletions {{cookiecutter.project_slug}}/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,66 @@
from os.path import join
from os.path import abspath
from os.path import dirname
import json

from setuptools import find_packages
from setuptools import setup

ROOT = abspath(dirname(__file__))

# please put setup keywords in the setup.json to keep this file clean
with open(join(ROOT, "setup.json"), "r") as f:
SETUP = json.load(f)

# see 4 > https://packaging.python.org/guides/single-sourcing-package-version/
with open(join(ROOT, "{{cookiecutter.project_slug}}", "VERSION"), "r") as f:
VERSION = f.read().strip()

setup(
# single source package version
version=VERSION,

# in combination with recursive-includes in MANIFEST.in, non-python files
# within the {{cookiecutter.project_slug}} will be copied into the
# site-packages and wheels installation directories
include_package_data=True,

# return a list all Python packages found within the ROOT directory
packages=find_packages(),

# pass parameters loaded from setup.json including author and version
**SETUP
)
# package-specific parameters
classifiers=[
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: Unix",
"Operating System :: POSIX",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Utilities",
],
entry_points={
"console_scripts": [
"{{cookiecutter.project_slug}}={{cookiecutter.project_slug}}.cli:main"
]
},
setup_requires=["pytest-runner>=5.3.1"],
install_requires=[{% if cookiecutter.cli_type == 'toil' %}"toil_container>=2.0.0"{% else %}"click>=7.0"{% endif %}],
extras_require={
"test": [
"coverage>=5.5.0",
"pydocstyle>=6.1.1",
"pytest-cov>=2.12.1",
"pytest>=6.2.5",
"pytest-env>=0.6.2",
"pytest-sugar>=0.9.1",
"pylint>=1.8.1",
"requests>=2.18.4",
"tox>=2.9.1",
]
},
author="{{cookiecutter.full_name}}",
keywords=[],
license="BSD",
name="{{cookiecutter.project_slug}}",
test_suite="tests",
description="{{cookiecutter.project_description}}",
long_description=(
"📘 learn more of this project on [GitHub]"
"(https://github.com/{{cookiecutter.github_account}}/{{cookiecutter.project_slug}})!"
),
long_description_content_type="text/markdown",
url="https://github.com/{{cookiecutter.github_account}}/{{cookiecutter.project_slug}}",
)

0 comments on commit 518557a

Please sign in to comment.