Skip to content

Commit

Permalink
fix #1060: dynamically generate MANIFEST.in
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed May 12, 2017
1 parent b258d82 commit 57bc1c5
Show file tree
Hide file tree
Showing 4 changed files with 159 additions and 18 deletions.
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
- 1040_: implemented full unicode support.
- 1051_: disk_usage() on Python 3 is now able to accept bytes.
- 1058_: test suite now enables all warnings by default.
- 1060_: source distribution is dynamically generated so that it only includes
relevant files.

**Bug fixes**

Expand Down
130 changes: 116 additions & 14 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,18 +1,120 @@
include *.bat
include *.rst
include .coveragerc
include CREDITS*
include .git-pre-commit
include .gitignore
include CREDITS
include DEVGUIDE.rst
include HISTORY.rst
include IDEAS
include INSTALL*
include LICENSE*
include HISTORY*
include INSTALL.rst
include LICENSE
include MANIFEST.in
include Makefile
include README.rst
include docs/Makefile
include docs/README
include docs/_static/copybutton.js
include docs/_static/favicon.ico
include docs/_static/sidebar.js
include docs/_template/globaltoc.html
include docs/_template/indexcontent.html
include docs/_template/indexsidebar.html
include docs/_template/page.html
include docs/_themes/pydoctheme/static/pydoctheme.css
include docs/_themes/pydoctheme/theme.conf
include docs/conf.py
include docs/index.rst
include docs/make.bat
include make.bat
include psutil/__init__.py
include psutil/_common.py
include psutil/_compat.py
include psutil/_psbsd.py
include psutil/_pslinux.py
include psutil/_psosx.py
include psutil/_psposix.py
include psutil/_pssunos.py
include psutil/_psutil_bsd.c
include psutil/_psutil_common.c
include psutil/_psutil_common.h
include psutil/_psutil_linux.c
include psutil/_psutil_osx.c
include psutil/_psutil_posix.c
include psutil/_psutil_posix.h
include psutil/_psutil_sunos.c
include psutil/_psutil_windows.c
include psutil/_pswindows.py
include psutil/arch/bsd/freebsd.c
include psutil/arch/bsd/freebsd.h
include psutil/arch/bsd/freebsd_socks.c
include psutil/arch/bsd/freebsd_socks.h
include psutil/arch/bsd/netbsd.c
include psutil/arch/bsd/netbsd.h
include psutil/arch/bsd/netbsd_socks.c
include psutil/arch/bsd/netbsd_socks.h
include psutil/arch/bsd/openbsd.c
include psutil/arch/bsd/openbsd.h
include psutil/arch/osx/process_info.c
include psutil/arch/osx/process_info.h
include psutil/arch/solaris/v10/ifaddrs.c
include psutil/arch/solaris/v10/ifaddrs.h
include psutil/arch/windows/glpi.h
include psutil/arch/windows/inet_ntop.c
include psutil/arch/windows/inet_ntop.h
include psutil/arch/windows/ntextapi.h
include psutil/arch/windows/process_handles.c
include psutil/arch/windows/process_handles.h
include psutil/arch/windows/process_info.c
include psutil/arch/windows/process_info.h
include psutil/arch/windows/security.c
include psutil/arch/windows/security.h
include psutil/arch/windows/services.c
include psutil/arch/windows/services.h
include psutil/tests/README.rst
include psutil/tests/__init__.py
include psutil/tests/__main__.py
include psutil/tests/test_bsd.py
include psutil/tests/test_connections.py
include psutil/tests/test_contracts.py
include psutil/tests/test_linux.py
include psutil/tests/test_memory_leaks.py
include psutil/tests/test_misc.py
include psutil/tests/test_osx.py
include psutil/tests/test_posix.py
include psutil/tests/test_process.py
include psutil/tests/test_sunos.py
include psutil/tests/test_system.py
include psutil/tests/test_unicode.py
include psutil/tests/test_windows.py
include scripts/battery.py
include scripts/cpu_distribution.py
include scripts/disk_usage.py
include scripts/fans.py
include scripts/free.py
include scripts/ifconfig.py
include scripts/internal/README
include scripts/internal/bench_oneshot.py
include scripts/internal/bench_oneshot_2.py
include scripts/internal/check_broken_links.py
include scripts/internal/download_exes.py
include scripts/internal/generate_manifest.py
include scripts/internal/print_announce.py
include scripts/internal/print_timeline.py
include scripts/internal/winmake.py
include scripts/iotop.py
include scripts/killall.py
include scripts/meminfo.py
include scripts/netstat.py
include scripts/nettop.py
include scripts/pidof.py
include scripts/pmap.py
include scripts/procinfo.py
include scripts/procsmem.py
include scripts/ps.py
include scripts/pstree.py
include scripts/sensors.py
include scripts/temperatures.py
include scripts/top.py
include scripts/who.py
include scripts/winservices.py
include setup.py
include tox.ini

recursive-include psutil *.py *.c *.h *.rst
recursive-include scripts *.py
recursive-include README*

recursive-include docs *.conf *.rst *.js *.html *.css *.py *.bat *Makefile* README*
recursive-exclude docs/_build *
recursive-exclude .ci *
14 changes: 10 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,6 @@ pyflakes:
flake8:
@git ls-files | grep \\.py$ | xargs $(PYTHON) -m flake8

check-manifest:
PYTHONWARNINGS=all $(PYTHON) -m check_manifest -v $(ARGS)

# ===================================================================
# GIT
# ===================================================================
Expand Down Expand Up @@ -243,8 +240,9 @@ pre-release:
assert ver in history, '%r not in HISTORY.rst' % ver; \
assert 'XXXX' not in history; \
"
${MAKE} win-download-exes
${MAKE} generate-manifest
PYTHONWARNINGS=all $(PYTHON) setup.py sdist
${MAKE} win-download-exes

# Create a release: creates tar.gz and exes/wheels, uploads them,
# upload doc, git tag release.
Expand All @@ -261,6 +259,14 @@ print-announce:
print-timeline:
@PYTHONWARNINGS=all $(PYTHON) scripts/internal/print_timeline.py

# Inspect MANIFEST.in file.
check-manifest:
PYTHONWARNINGS=all $(PYTHON) -m check_manifest -v $(ARGS)

# Generates MANIFEST.in file.
generate-manifest:
@PYTHONWARNINGS=all $(PYTHON) scripts/internal/generate_manifest.py > MANIFEST.in

# ===================================================================
# Misc
# ===================================================================
Expand Down
31 changes: 31 additions & 0 deletions scripts/internal/generate_manifest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env python

# Copyright (c) 2009 Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

"""
Generate MANIFEST.in file.
"""

import os
import subprocess


def sh(cmd):
return subprocess.check_output(
cmd, shell=True, universal_newlines=True).strip()


def main():
files = sh("git ls-files").split('\n')
for file in files:
if file.startswith('.ci/') or \
os.path.splitext(file)[1] in ('.png', '.jpg') or \
file in ('.travis.yml', 'appveyor.yml'):
continue
print("include " + file)


if __name__ == '__main__':
main()

0 comments on commit 57bc1c5

Please sign in to comment.