19
19
except IOError :
20
20
long_description = ''
21
21
22
- ################################################################################
22
+ #############################################################################
23
23
# find_package_data is an Ian Bicking creation.
24
24
25
25
# Provided as an attribute, so you can append to these instead
29
29
'./dist' , 'EGG-INFO' , '*.egg-info' )
30
30
31
31
32
- def find_package_data (
33
- where = '.' , package = '' ,
34
- exclude = standard_exclude ,
35
- exclude_directories = standard_exclude_directories ,
36
- only_in_packages = True ,
37
- show_ignored = False ):
32
+ def find_package_data (where = '.' ,
33
+ package = '' ,
34
+ exclude = standard_exclude ,
35
+ exclude_directories = standard_exclude_directories ,
36
+ only_in_packages = True ,
37
+ show_ignored = False ,
38
+ ):
38
39
"""
39
40
Return a dictionary suitable for use in ``package_data``
40
41
in a distutils ``setup.py`` file.
@@ -74,7 +75,7 @@ def find_package_data(
74
75
bad_name = False
75
76
for pattern in exclude_directories :
76
77
if (fnmatchcase (name , pattern )
77
- or fn .lower () == pattern .lower ()):
78
+ or fn .lower () == pattern .lower ()):
78
79
bad_name = True
79
80
if show_ignored :
80
81
print >> sys .stderr , (
@@ -90,13 +91,16 @@ def find_package_data(
90
91
new_package = package + '.' + name
91
92
stack .append ((fn , '' , new_package , False ))
92
93
else :
93
- stack .append ((fn , prefix + name + '/' , package , only_in_packages ))
94
+ stack .append ((fn ,
95
+ prefix + name + '/' ,
96
+ package ,
97
+ only_in_packages ))
94
98
elif package or not only_in_packages :
95
99
# is a file
96
100
bad_name = False
97
101
for pattern in exclude :
98
102
if (fnmatchcase (name , pattern )
99
- or fn .lower () == pattern .lower ()):
103
+ or fn .lower () == pattern .lower ()):
100
104
bad_name = True
101
105
if show_ignored :
102
106
print >> sys .stderr , (
@@ -107,8 +111,66 @@ def find_package_data(
107
111
continue
108
112
out .setdefault (package , []).append (prefix + name )
109
113
return out
110
- ################################################################################
111
-
114
+ ############################################################################
115
+
116
+ us_pkg = 'virtualenvwrapper.user_scripts'
117
+
118
+ entry_points = {
119
+ 'virtualenvwrapper.initialize' : [
120
+ 'user_scripts = %s:initialize' % us_pkg ,
121
+ 'project = virtualenvwrapper.project:initialize' ,
122
+ ],
123
+ 'virtualenvwrapper.initialize_source' : [
124
+ 'user_scripts = %s:initialize_source' % us_pkg ,
125
+ ],
126
+
127
+ 'virtualenvwrapper.pre_mkvirtualenv' : [
128
+ 'user_scripts = %s:pre_mkvirtualenv' % us_pkg ,
129
+ ],
130
+ 'virtualenvwrapper.post_mkvirtualenv_source' : [
131
+ 'user_scripts = %s:post_mkvirtualenv_source' % us_pkg ,
132
+ ],
133
+
134
+ 'virtualenvwrapper.pre_cpvirtualenv' : [
135
+ 'user_scripts = %s:pre_cpvirtualenv' % us_pkg ,
136
+ ],
137
+ 'virtualenvwrapper.post_cpvirtualenv_source' : [
138
+ 'user_scripts = %s:post_cpvirtualenv_source' % us_pkg ,
139
+ ],
140
+
141
+ 'virtualenvwrapper.pre_rmvirtualenv' : [
142
+ 'user_scripts = %s:pre_rmvirtualenv' % us_pkg ,
143
+ ],
144
+ 'virtualenvwrapper.post_rmvirtualenv' : [
145
+ 'user_scripts = %s:post_rmvirtualenv' % us_pkg ,
146
+ ],
147
+
148
+ 'virtualenvwrapper.project.pre_mkproject' : [
149
+ 'project = virtualenvwrapper.project:pre_mkproject' ,
150
+ ],
151
+ 'virtualenvwrapper.project.post_mkproject_source' : [
152
+ 'project = virtualenvwrapper.project:post_mkproject_source' ,
153
+ ],
154
+
155
+ 'virtualenvwrapper.pre_activate' : [
156
+ 'user_scripts = %s:pre_activate' % us_pkg ,
157
+ ],
158
+ 'virtualenvwrapper.post_activate_source' : [
159
+ 'user_scripts = %s:post_activate_source' % us_pkg ,
160
+ 'project = virtualenvwrapper.project:post_activate_source' ,
161
+ ],
162
+
163
+ 'virtualenvwrapper.pre_deactivate_source' : [
164
+ 'user_scripts = %s:pre_deactivate_source' % us_pkg ,
165
+ ],
166
+ 'virtualenvwrapper.post_deactivate_source' : [
167
+ 'user_scripts = %s:post_deactivate_source' % us_pkg ,
168
+ ],
169
+
170
+ 'virtualenvwrapper.get_env_details' : [
171
+ 'user_scripts = %s:get_env_details' % us_pkg ,
172
+ ],
173
+ }
112
174
113
175
setup (
114
176
name = PROJECT ,
@@ -155,68 +217,12 @@ def find_package_data(
155
217
# Scan the input for package information
156
218
# to grab any data files (text, images, etc.)
157
219
# associated with sub-packages.
158
- package_data = find_package_data (PROJECT ,
220
+ package_data = find_package_data (PROJECT ,
159
221
package = PROJECT ,
160
222
only_in_packages = False ,
161
223
),
162
224
163
- entry_points = {
164
- #'console_scripts': [ 'venvw_hook = virtualenvwrapper.hook_loader:main' ],
165
- 'virtualenvwrapper.initialize' : [
166
- 'user_scripts = virtualenvwrapper.user_scripts:initialize' ,
167
- 'project = virtualenvwrapper.project:initialize' ,
168
- ],
169
- 'virtualenvwrapper.initialize_source' : [
170
- 'user_scripts = virtualenvwrapper.user_scripts:initialize_source' ,
171
- ],
172
-
173
- 'virtualenvwrapper.pre_mkvirtualenv' : [
174
- 'user_scripts = virtualenvwrapper.user_scripts:pre_mkvirtualenv' ,
175
- ],
176
- 'virtualenvwrapper.post_mkvirtualenv_source' : [
177
- 'user_scripts = virtualenvwrapper.user_scripts:post_mkvirtualenv_source' ,
178
- ],
179
-
180
- 'virtualenvwrapper.pre_cpvirtualenv' : [
181
- 'user_scripts = virtualenvwrapper.user_scripts:pre_cpvirtualenv' ,
182
- ],
183
- 'virtualenvwrapper.post_cpvirtualenv_source' : [
184
- 'user_scripts = virtualenvwrapper.user_scripts:post_cpvirtualenv_source' ,
185
- ],
186
-
187
- 'virtualenvwrapper.pre_rmvirtualenv' : [
188
- 'user_scripts = virtualenvwrapper.user_scripts:pre_rmvirtualenv' ,
189
- ],
190
- 'virtualenvwrapper.post_rmvirtualenv' : [
191
- 'user_scripts = virtualenvwrapper.user_scripts:post_rmvirtualenv' ,
192
- ],
193
-
194
- 'virtualenvwrapper.project.pre_mkproject' : [
195
- 'project = virtualenvwrapper.project:pre_mkproject' ,
196
- ],
197
- 'virtualenvwrapper.project.post_mkproject_source' : [
198
- 'project = virtualenvwrapper.project:post_mkproject_source' ,
199
- ],
200
-
201
- 'virtualenvwrapper.pre_activate' : [
202
- 'user_scripts = virtualenvwrapper.user_scripts:pre_activate' ,
203
- ],
204
- 'virtualenvwrapper.post_activate_source' : [
205
- 'user_scripts = virtualenvwrapper.user_scripts:post_activate_source' ,
206
- 'project = virtualenvwrapper.project:post_activate_source' ,
207
- ],
208
-
209
- 'virtualenvwrapper.pre_deactivate_source' : [
210
- 'user_scripts = virtualenvwrapper.user_scripts:pre_deactivate_source' ,
211
- ],
212
- 'virtualenvwrapper.post_deactivate_source' : [
213
- 'user_scripts = virtualenvwrapper.user_scripts:post_deactivate_source' ,
214
- ],
215
-
216
- 'virtualenvwrapper.get_env_details' : [
217
- 'user_scripts = virtualenvwrapper.user_scripts:get_env_details' ,
218
- ],
219
- },
225
+ entry_points = entry_points ,
220
226
221
227
zip_safe = False ,
222
- )
228
+ )
0 commit comments