Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

Setuptools improvements #166

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
setup: Remove get_packages, get_package_data
The former of these duplicates functionality already provided by
setuptools, while the latter doesn't do anything. Replace the first and
remove the second.

Signed-off-by: Stephen Finucane <stephen@that.guru>
  • Loading branch information
stephenfin committed Apr 24, 2018
commit 6af2e2e5c8377da0f54f6b93c14977a8be497210
32 changes: 3 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup
from setuptools import find_packages, setup
import re
import os
import shutil
import sys


Expand All @@ -16,31 +15,6 @@ def get_version(package):
return re.search("__version__ = ['\"]([^'\"]+)['\"]", init_py).group(1)


def get_packages(package):
"""
Return root package and all sub-packages.
"""
return [dirpath
for dirpath, dirnames, filenames in os.walk(package)
if os.path.exists(os.path.join(dirpath, '__init__.py'))]


def get_package_data(package):
"""
Return all files under the root package, that are not in a
package themselves.
"""
walk = [(dirpath.replace(package + os.sep, '', 1), filenames)
for dirpath, dirnames, filenames in os.walk(package)
if not os.path.exists(os.path.join(dirpath, '__init__.py'))]

filepaths = []
for base, filenames in walk:
filepaths.extend([os.path.join(base, filename)
for filename in filenames])
return {package: filepaths}


version = get_version('coreapi')


Expand All @@ -60,8 +34,8 @@ def get_package_data(package):
description='Python client library for Core API.',
author='Tom Christie',
author_email='tom@tomchristie.com',
packages=get_packages('coreapi'),
package_data=get_package_data('coreapi'),
packages=find_packages('coreapi'),
include_package_data=True,
install_requires=[
'coreschema',
'requests',
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy