summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--distutils2/_backport/pkgutil.py2
-rw-r--r--distutils2/command/install_data.py8
-rw-r--r--docs/source/setupcfg.rst27
3 files changed, 30 insertions, 7 deletions
diff --git a/distutils2/_backport/pkgutil.py b/distutils2/_backport/pkgutil.py
index 36b7b28..ecd42a5 100644
--- a/distutils2/_backport/pkgutil.py
+++ b/distutils2/_backport/pkgutil.py
@@ -1169,4 +1169,4 @@ def get_file_users(path):
yield dist
def open(distribution_name, relative_path):
-
+ pass
diff --git a/distutils2/command/install_data.py b/distutils2/command/install_data.py
index 6fe3805..59d020a 100644
--- a/distutils2/command/install_data.py
+++ b/distutils2/command/install_data.py
@@ -9,7 +9,7 @@ platform-independent data files."""
import os
from distutils2.command.cmd import Command
from distutils2.util import change_root, convert_path
-from distutils2._backport.sysconfig import _expand_vars, _subst_vars, get_paths
+from distutils2._backport.sysconfig import get_paths
class install_data(Command):
@@ -55,8 +55,8 @@ class install_data(Command):
def expand_categories(self, path_with_categories):
local_vars = get_paths()
local_vars['distribution.name'] = self.distribution.metadata['Name']
- expanded_path = _subst_vars(path_with_categories, local_vars)
- expanded_path = _subst_vars(expanded_path, local_vars)
+ expanded_path = get_paths(path_with_categories, local_vars)
+ expanded_path = get_paths(expanded_path, local_vars)
if '{' in expanded_path and '}' in expanded_path:
self.warn("Unable to expand %s, some categories may missing." %
path_with_categories)
@@ -66,7 +66,7 @@ class install_data(Command):
sources = []
for file in self.data_files:
destination = convert_path(self.expand_categories(file[1]))
- if os.path.file(destination):
+ if os.path.isfile(destination):
sources.append(destination)
return sources
diff --git a/docs/source/setupcfg.rst b/docs/source/setupcfg.rst
index b900f97..01291a7 100644
--- a/docs/source/setupcfg.rst
+++ b/docs/source/setupcfg.rst
@@ -152,15 +152,38 @@ Example::
data-files
==========
+###
+source -> destination
+
+fichier-final = destination + source
+
+There is an {alias} for each categories of datafiles
+-----
+source may be a glob (*, ?, **, {})
+
+order
+
+exclude
+--
+base-prefix
+
+####
+overwrite system config for {alias}
+
+####
+extra-categori
+
This section describes the files used by the project which must not be installed in the same place that python modules or libraries.
The format for specifing data files is :
- **glob_syntax** = **destination**
+ **source** = **destination**
Example::
- scripts/ *.bin = {scripts}
+ scripts/script1.bin = {scripts}
+
+It means that the file scripts/script1.bin will be placed
It means that every file which match the glob_syntax will be placed in the destination. A part of the path of the file will be stripped when it will be expanded and another part will be append to the destination. For more informations about which part of the path will be stripped or not, take a look at next sub-section globsyntax_.