Browse Source

Generate a MANIFEST.in from setup.py; more setup.py and Makefile updates

tags/nilmdb-1.0
Jim Paris 11 years ago
parent
commit
f071d749ce
3 changed files with 57 additions and 3 deletions
  1. +3
    -0
      .gitignore
  2. +18
    -1
      Makefile
  3. +36
    -2
      setup.py

+ 3
- 0
.gitignore View File

@@ -18,6 +18,9 @@ nilmdb/server/rbtree.so
dist/
nilmdb.egg-info/

# This gets generated as needed by setup.py
MANIFEST.in

# Misc
timeit*out


+ 18
- 1
Makefile View File

@@ -1,5 +1,19 @@
# By default, run the tests.
all: test

build:
python setup.py build_ext --inplace

dist: sdist
sdist:
python setup.py sdist

install:
python setup.py install

docs:
make -C docs

lint:
pylint --rcfile=.pylintrc nilmdb

@@ -10,4 +24,7 @@ clean::
find . -name '*pyc' | xargs rm -f
rm -f .coverage
rm -rf tests/*testdb*
rm -rf nilmdb.egg-info/ build/ nilmdb/server/*.c nilmdb/server/*.so
rm -rf nilmdb.egg-info/ build/ nilmdb/server/*.c nilmdb/server/*.so MANIFEST.in
make -C docs clean

.PHONY: all build dist sdist install docs lint test clean

+ 36
- 2
setup.py View File

@@ -26,14 +26,48 @@ except ImportError:
try: import multiprocessing
except: pass

# Build cython modules.
cython_modules = cythonize("**/*.pyx")
if len(sys.argv) == 2 and sys.argv[1] == 'sdist':
# When building just a source distribution package, skip Cython,
# so that the generated .c files don't get included. This isn't
# foolproof, but the worst case is that the .c files get included,
# which is fine.
cython_modules = []
else:
# Build cython modules.
cython_modules = cythonize("**/*.pyx")

# We need a MANIFEST.in. Generate it here rather than polluting the
# repository with yet another setup-related file.
with open("MANIFEST.in", "w") as m:
m.write("""
# Root
include README.txt
include setup.cfg
include setup.py
include Makefile
include .coveragerc
include .pylintrc

# Cython files -- include source.
recursive-include nilmdb/server *.pyx *.pyxdep *.pxd

# Tests
recursive-include tests *.py
recursive-include tests/data *
include tests/test.order

# Docs
recursive-include docs Makefile *.md
""")

# Run setup
setup(name='nilmdb',
version = '1.0',
url = 'https://git.jim.sh/jim/lees/nilmdb.git',
author = 'Jim Paris',
description = "NILM Database",
long_description = "NILM Database",
license = "Proprietary",
author_email = 'jim@jtan.com',
tests_require = [ 'nose',
'coverage',


Loading…
Cancel
Save