Skip to content

Commit 0c54c49

Browse files
authored
Merge pull request statsmodels#5195 from bashtage/include-license-wheel
BLD: Include License in Wheel
2 parents 12111e6 + 5b4ca1f commit 0c54c49

File tree

5 files changed

+25
-40
lines changed

5 files changed

+25
-40
lines changed

.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
# setup.py working directory
33
build
44
# setup.py dist directory
5-
./dist
65
dist
76
#docs build and others
87
#generated #not yet? generated for dataset not rebuild
@@ -47,9 +46,9 @@ marks.bzr
4746
*.svn/
4847
*.log.py
4948
# Egg metadata
50-
./*.egg-info
49+
*.egg-info
5150
# The shelf plugin uses this dir
52-
./.shelf
51+
.shelf
5352
# Mac droppings
5453
.DS_Store
5554
help
@@ -90,3 +89,7 @@ statsmodels/tsa/statespace/_smoothers/_classical.pyx
9089
#pytest
9190
.cache
9291
.pytest_cache
92+
93+
# Temporary copies for packaging
94+
statsmodels/setup.cfg
95+
statsmodels/LICENSE.txt

LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All rights reserved.
44
Copyright (c) 2006-2008 Scipy Developers.
55
All rights reserved.
66

7-
Copyright (c) 2009-2012 Statsmodels Developers.
7+
Copyright (c) 2009-2018 Statsmodels Developers.
88
All rights reserved.
99

1010

setup.cfg

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
[metadata]
2+
license_file = LICENSE.txt
3+
14
[tool:pytest]
25
minversion = 3.6
36
testpaths = statsmodels

setup.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import fnmatch
99
import os
1010
import sys
11+
import shutil
1112
from collections import defaultdict
1213
from os.path import relpath, abspath, split, join as pjoin
1314

@@ -106,7 +107,17 @@
106107
'Topic :: Office/Business :: Financial',
107108
'Topic :: Scientific/Engineering']
108109

110+
FILES_TO_INCLUDE_IN_PACKAGE = ['LICENSE.txt', 'setup.cfg']
111+
112+
FILES_COPIED_TO_PACKAGE = []
113+
for filename in FILES_TO_INCLUDE_IN_PACKAGE:
114+
if os.path.exists(filename):
115+
dest = os.path.join('statsmodels', filename)
116+
shutil.copy2(filename, dest)
117+
FILES_COPIED_TO_PACKAGE.append(dest)
118+
109119
ADDITIONAL_PACKAGE_DATA = {
120+
'statsmodels': FILES_TO_INCLUDE_IN_PACKAGE,
110121
'statsmodels.datasets.tests': ['*.zip'],
111122
'statsmodels.iolib.tests.results': ['*.dta'],
112123
'statsmodels.stats.tests.results': ['*.json'],
@@ -327,3 +338,7 @@ def is_pure(self):
327338
zip_safe=False,
328339
data_files=[('', ['LICENSE.txt', 'setup.cfg'])]
329340
)
341+
342+
# Clean-up copied files
343+
for copy in FILES_COPIED_TO_PACKAGE:
344+
os.unlink(copy)

statsmodels/LICENSE.txt

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)