Skip to content

Commit 6353490

Browse files
author
kic
committed
check links
1 parent 15688ae commit 6353490

File tree

4 files changed

+75
-29
lines changed

4 files changed

+75
-29
lines changed

pandas-ml-utils-torch/Readme.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ advantages:
99
* allows to implement auto-encoders easily by just providing the encode/decode functions
1010
* added loss functions like `SoftDTW` (fit time series) loss or `HeteroscedasticityLoss` (fit Normal Distribution) -> [example][ghl3]
1111

12-
<br><br>
12+
<br/><br/>
1313

1414
![Fitting Example][ghi1]
1515

pandas-ml-utils-torch/noxfile.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
@nox.session(python=["3.8"], reuse_venv=False, venv_params=['--system-site-packages'])
1313
def tests(session):
14+
dist_file = f"/tmp/pandas-ml-utils-torch-{__version__}.zip"
15+
1416
# install testing requirements and local dependencies
1517
session.install("-r", "dev-requirements.txt")
1618
session.install("-r", "requirements.txt")
@@ -22,7 +24,7 @@ def tests(session):
2224

2325
# create distribution and install
2426
session.run("python", "setup.py", "sdist", "-d", "/tmp/", "--formats=zip", env={})
25-
session.install(f"/tmp/pandas-ml-utils-torch-{__version__}.zip", "--no-deps")
27+
session.install(dist_file, "--no-deps")
2628

2729
# create notebook kernels
2830
kernel = "ml_utils_torch"
@@ -43,3 +45,6 @@ def tests(session):
4345

4446
# clean up egg info
4547
shutil.rmtree("pandas_ml_utils_torch.egg-info")
48+
49+
# make link check
50+
session.run("python", "pandas_ml_utils_torch_test/check_links.py", dist_file)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import sys
2+
3+
from pandas_ml_common_test.link_checker import check_links_in_dist
4+
5+
6+
if __name__ == "__main__":
7+
_, dist = sys.argv
8+
check_links_in_dist(dist, 'Readme.md')

pandas-ml-utils-torch/setup.py

+60-27
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,68 @@
11
"""Augment pandas DataFrame with methods for machine learning"""
22
__version__ = '0.2.1'
3-
43
import os
4+
import re
5+
56
from setuptools import setup, find_packages
7+
from setuptools.command.sdist import sdist
8+
9+
URL = 'https://github.com/KIC/pandas-ml-quant'
10+
NAME = 'pandas-ml-utils-torch'
11+
12+
13+
class SDist(sdist):
14+
15+
def fix_github_links(self, lines):
16+
# ist https://github.com/KIC/pandas-ml-quant/pandas-ml-common/tree/0.2.0/./examples/
17+
# soll https://github.com/KIC/pandas-ml-quant/tree/0.2.0/pandas-ml-common/./examples/
18+
def fix_line(line):
19+
fixed_images = re.sub(r'(^\[ghi\d+]:\s+)', f'\\1{URL}/raw/{__version__}/{NAME}/', line)
20+
fixed_location = re.sub(r'(^\[ghl\d+]:\s+)', f'\\1{URL}/tree/{__version__}/{NAME}/', fixed_images)
21+
fixed_files = re.sub(r'(^\[ghf\d+]:\s+)', f'\\1{URL}/blob/{__version__}/{NAME}/', fixed_location)
22+
return fixed_files
23+
24+
return [fix_line(line) for line in lines]
25+
26+
def make_release_tree(self, base_dir, files):
27+
# create the regular distribution files
28+
super().make_release_tree(base_dir, files)
29+
30+
# but then fix the github links
31+
readme_file = os.path.join(base_dir, 'Readme.md')
32+
readme_lines = open(readme_file).readlines()
33+
34+
with open(readme_file, 'w') as f:
35+
f.writelines(self.fix_github_links(readme_lines))
636

737

838
setup(
9-
name="pandas-ml-utils-torch",
10-
version=__version__,
11-
author='KIC',
12-
author_email='',
13-
packages=find_packages(),
14-
scripts=[],
15-
url='https://github.com/KIC/pandas-ml-quant',
16-
license='MIT',
17-
description=__doc__,
18-
long_description=open('Readme.md').read(),
19-
long_description_content_type='text/markdown',
20-
install_requires=open("requirements.txt").read().splitlines() + [f"pandas-ml-common=={__version__}", f"pandas-ml-utils=={__version__}"],
21-
extras_require={
22-
"dev": open("dev-requirements.txt").read().splitlines(),
23-
},
24-
include_package_data=True,
25-
classifiers=[
26-
# Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
27-
'Development Status :: 3 - Alpha',
28-
'Intended Audience :: Developers',
29-
'Topic :: Software Development :: Build Tools',
30-
'License :: OSI Approved :: MIT License',
31-
'Programming Language :: Python :: 3',
32-
'Programming Language :: Python :: 3.7',
33-
],
34-
keywords=['pandas', 'ml', 'util', 'quant'],
39+
name=NAME,
40+
version=__version__,
41+
author='KIC',
42+
author_email='',
43+
packages=find_packages(),
44+
scripts=[],
45+
url=f'{URL}/{NAME}',
46+
license='MIT',
47+
description=__doc__,
48+
long_description=open('Readme.md').read(),
49+
long_description_content_type='text/markdown',
50+
install_requires=open("requirements.txt").read().splitlines() + [f"pandas-ml-common=={__version__}", f"pandas-ml-utils=={__version__}"],
51+
extras_require={
52+
"dev": open("dev-requirements.txt").read().splitlines(),
53+
},
54+
include_package_data=True,
55+
classifiers=[
56+
# Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
57+
'Development Status :: 3 - Alpha',
58+
'Intended Audience :: Developers',
59+
'Topic :: Software Development :: Build Tools',
60+
'License :: OSI Approved :: MIT License',
61+
'Programming Language :: Python :: 3',
62+
'Programming Language :: Python :: 3.8',
63+
],
64+
keywords=['pandas', 'ml', 'util', 'quant'],
65+
cmdclass={
66+
'sdist': SDist
67+
},
3568
)

0 commit comments

Comments
 (0)