Skip to content

Commit

Permalink
move most of setup.py to pyproject.toml and setup.cfg
Browse files Browse the repository at this point in the history
fixing setuptools_scm

use isolated build for package creation
  • Loading branch information
luizirber committed Aug 4, 2020
1 parent 14e9cb6 commit e8f7afa
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 71 deletions.
4 changes: 2 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ global-exclude *.rlib
global-exclude *.orig
global-exclude *.pyc
global-exclude *.so
prune tests/test-data/
global-exclude *.git/
prune tests/test-data
global-exclude *.git
10 changes: 7 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
[build-system]
requires = [
"setuptools >= 40.0.4",
"setuptools_scm >= 2.0.0, <4",
"setuptools >= 42",
"setuptools_scm[toml] >= 3.4.0, <4",
"setuptools_scm_git_archive",
"milksnake",
"wheel >= 0.29.0",
"Cython >= 0.25.2",
]
build-backend = 'setuptools.build_meta'

[tool.setuptools_scm]
write_to = "sourmash/version.py"
git_describe_command = "git describe --dirty --tags --long --match v* --first-parent"
87 changes: 85 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,86 @@
[metadata]
description-file = README.md
long-description-content-type = text/markdown
name = sourmash
description = tools for comparing DNA sequences with MinHash sketches
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/dib-lab/sourmash
author = C. Titus Brown
author_email = titus@idyll.org
license = BSD 3-clause
classifiers =
Development Status :: 5 - Production/Stable
Environment :: Console
Environment :: MacOS X
Intended Audience :: Science/Research
License :: OSI Approved :: BSD License
Natural Language :: English
Operating System :: POSIX :: Linux
Operating System :: MacOS :: MacOS X
Programming Language :: Rust
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: Scientific/Engineering :: Bio-Informatics
project_urls =
Documentation = https://sourmash.readthedocs.io
CI = https://travis-ci.com/dib-lab/sourmash

[options]
zip_safe = False
platforms = any
#packages = find: exclude=["tests", "benchmarks"]
packages = find:
include_package_data = True
install_requires =
screed>=0.9
cffi>=1.14.0
numpy
enum34; python_version < "3.4"
matplotlib
scipy
deprecation>=2.0.6

[options.packages.find]
exclude =
tests
benchmarks

[bdist_wheel]
universal = 1

# for explanation of %(extra)s syntax see:
# https://github.com/pypa/setuptools/issues/1260#issuecomment-438187625
# this syntax may change in the future
[options.extras_require]
test =
pytest
pytest-cov
recommonmark
hypothesis
demo =
jupyter
jupyter_client
ipython
doc =
sphinx
myst-parser[sphinx]
alabaster
sphinxcontrib-napoleon
nbsphinx
ipython
10x =
bam2fasta==1.0.4
storage =
ipfshttpclient>=0.4.13
redis
all =
%(test)s
%(demo)s
%(doc)s
%(10x)s
%(storage)s

[options.entry_points]
console_scripts =
sourmash = sourmash.__main__:main
69 changes: 5 additions & 64 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import print_function
import os
from setuptools import setup, find_packages
import sys

from setuptools import setup


DEBUG_BUILD = os.environ.get("SOURMASH_DEBUG") == "1"

Expand All @@ -28,65 +28,6 @@ def build_native(spec):
)


CLASSIFIERS = [
"Environment :: Console",
"Environment :: MacOS X",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Natural Language :: English",
"Operating System :: POSIX :: Linux",
"Operating System :: MacOS :: MacOS X",
"Programming Language :: Rust",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]

CLASSIFIERS.append("Development Status :: 5 - Production/Stable")

with open("README.md", "r") as readme:
LONG_DESCRIPTION = readme.read()

SETUP_METADATA = {
"name": "sourmash",
"description": "tools for comparing DNA sequences with MinHash sketches",
"url": "https://github.com/dib-lab/sourmash",
"author": "C. Titus Brown",
"author_email": "titus@idyll.org",
"license": "BSD 3-clause",
"packages": find_packages(exclude=["tests", "benchmarks"]),
"entry_points": {'console_scripts': [
'sourmash = sourmash.__main__:main'
]
},
"install_requires": ['screed>=0.9', 'cffi>=1.14.0', 'numpy',
'enum34; python_version < "3.4"',
'matplotlib', 'scipy', 'deprecation>=2.0.6'],
"setup_requires": [
"setuptools>=38.6.0",
"milksnake",
"setuptools_scm>=3.2.0",
"setuptools_scm_git_archive",
],
"use_scm_version": {
"write_to": "sourmash/version.py",
"git_describe_command": "git describe --dirty --tags --long --match v* --first-parent"
},
"zip_safe": False,
"platforms": "any",
"extras_require": {
'test' : ['pytest', 'pytest-cov', 'recommonmark', 'hypothesis'],
'demo' : ['jupyter', 'jupyter_client', 'ipython'],
'doc' : ['sphinx', 'myst-parser[sphinx]', 'alabaster',
"sphinxcontrib-napoleon", "nbsphinx",
"ipython"],
'10x': ['bam2fasta==1.0.4'],
'storage': ["ipfshttpclient>=0.4.13", "redis"]
},
"include_package_data": True,
"classifiers": CLASSIFIERS,
"milksnake_tasks": [build_native],
}

setup(**SETUP_METADATA)
setup(
milksnake_tasks=[build_native],
)

0 comments on commit e8f7afa

Please sign in to comment.