Skip to content

Commit

Permalink
More modern package layout (#1025)
Browse files Browse the repository at this point in the history
  • Loading branch information
nils-braun committed Jun 8, 2023
1 parent e91e2a3 commit 6991bc7
Show file tree
Hide file tree
Showing 14 changed files with 102 additions and 169 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmark_default_branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r test-requirements.txt
pip install ".[testing]"
- name: Run benchmark
run: |
cd tests
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: "3.8"
cache: 'pip' # caching pip dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
60 changes: 2 additions & 58 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,77 +14,21 @@ jobs:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
installation: ["lowest", "highest"]
include:
- python-version: 3.7
installation: "lowest"

NUMPY: "1.15.1"
PANDAS: "1.0.5" # see https://github.com/numpy/numpy/issues/18355
SCIKITLEARN: "0.22.0"
DASK: "2.9.0"
DISTRIBUTED: "2.11.0"
SCIPY: "1.2.0"
STATSMODELS: "0.13.0"

- python-version: 3.8
installation: "lowest"

# only starting from these version, there is a wheel
NUMPY: "1.17.3"
PANDAS: "1.0.5"
SCIKITLEARN: "0.22.0"
DASK: "2.9.0"
DISTRIBUTED: "2.11.0"
# 1.2.0 is not installable with python 3.8...
SCIPY: "1.4.0"
STATSMODELS: "0.13.0"

- python-version: 3.9
installation: "lowest"

# only starting from these version, there is a wheel
NUMPY: "1.20.3"
PANDAS: "1.3.5"
SCIKITLEARN: "1.0.1"
DASK: "2021.12.0"
DISTRIBUTED: "2021.12.0"
SCIPY: "1.7.3"
STATSMODELS: "0.13.0"

steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('test-requirements.txt') }}-${{ matrix.python-version }}-${{ matrix.installation }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('test-requirements.txt') }}-${{ matrix.python-version }}-${{ matrix.installation }}
cache: 'pip' # caching pip dependencies

- name: Install dependencies
run: |
# Do all the installations
python -m pip install --upgrade pip wheel setuptools
# Now downgrade packages if required by environment variables
[ -z "${{matrix.NUMPY}}" ] || pip install numpy==${{matrix.NUMPY}}
[ -z "${{matrix.PANDAS}}" ] || pip install pandas==${{matrix.PANDAS}}
[ -z "${{matrix.SCIKITLEARN}}" ] || pip install scikit-learn==${{matrix.SCIKITLEARN}}
[ -z "${{matrix.STATSMODELS}}" ] || pip install statsmodels==${{matrix.STATSMODELS}}
[ -z "${{matrix.DASK}}" ] || pip install dask==${{matrix.DASK}}
[ -z "${{matrix.DISTRIBUTED}}" ] || pip install distributed==${{matrix.DISTRIBUTED}}
# need to downgrade tornado manually
[ -z "${{matrix.SCIPY}}" ] || pip install scipy==${{matrix.SCIPY}}
pip install -r requirements.txt -r test-requirements.txt
pip install .
pip install .[testing]
# Print out the pip versions for debugging
pip list
Expand Down
17 changes: 4 additions & 13 deletions .github/workflows/test_all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,17 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Set up Python 3.7
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('test-requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}-${{ hashFiles('test-requirements.txt') }}
python-version: 3.9
cache: 'pip' # caching pip dependencies

- name: Install dependencies
run: |
# Do all the installations
python -m pip install --upgrade pip wheel setuptools
pip uninstall tsfresh
pip install -r requirements.txt -r test-requirements.txt
pip install .
pip install .[testing]
# Print out the pip versions for debugging
pip list
Expand Down
3 changes: 2 additions & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ python:
install:
- method: pip
path: .
- requirements: rdocs-requirements.txt
extra_requirements:
- docs
4 changes: 1 addition & 3 deletions binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
-e . # relative to cwd
-r ../requirements.txt # relative to here
-r ../test-requirements.txt # relative to here
-e .[testing]
12 changes: 5 additions & 7 deletions docs/text/how_to_contribute.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,8 @@ Install all the relevant python packages with
.. code::
cd /path/to/tsfresh
pip install -r requirements.txt
pip install -r rdocs-requirements.txt
pip install -r test-requirements.txt
pip install -e ".[testing]"
pre-commit install
pip install -e .
The last command will dynamically link the tsfresh package which means that changes to the code will directly show up
Expand All @@ -67,7 +64,7 @@ you have to:

.. code::
pytest tests/
pytest
Documentation
Expand All @@ -78,8 +75,9 @@ Build the documentation after installing as described above with

.. code::
python setup.py docs
pip install -e ".[docs]"
cd docs
make html
The finished documentation can be found in the docs/_build/html folder.

Expand Down
6 changes: 0 additions & 6 deletions install_requirements.sh

This file was deleted.

1 change: 0 additions & 1 deletion optional-requirements.txt

This file was deleted.

5 changes: 0 additions & 5 deletions rdocs-requirements.txt

This file was deleted.

12 changes: 0 additions & 12 deletions requirements.txt

This file was deleted.

102 changes: 73 additions & 29 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# This file is used to configure your project.
# Read more about the various options under:
# http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files
[metadata]
name = tsfresh
summary = tsfresh extracts relevant characteristics from time series
author = Maximilian Christ, Nils Braun, Julius Neuffer, Andreas W. Kempa-Liehr
author-email = max.christ@me.com
author_email = max.christ@me.com
license = MIT
home-page = https://github.com/blue-yonder/tsfresh
home_page = https://github.com/blue-yonder/tsfresh
# Add here all kinds of additional classifiers as defined under
# https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifier =
Expand All @@ -23,50 +26,91 @@ classifier =
Topic :: Scientific/Engineering
Topic :: Software Development


[options]
packages = find:
# DON'T CHANGE THE FOLLOWING LINE! IT WILL BE UPDATED BY PYSCAFFOLD!
setup_requires =
pyscaffold>=3.3a0,<4
# Add here dependencies of your project (semicolon/line-separated), e.g.
install_requires =
requests>=2.9.1
numpy >=1.15.1, <1.24
pandas>=0.25.0, <2.0.0
scipy>=1.2.0
statsmodels>=0.13
patsy>=0.4.1
scikit-learn>=0.22.0
tqdm>=4.10.0
dask[dataframe]>=2.9.0
distributed>=2.11.0
stumpy>=1.7.2
cloudpickle

# Require a specific Python version, e.g. Python 2.7 or >= 3.4
python_requires = >= 3.7

[entry_points]
# Add here console scripts like:
# console_scripts =
# script_name = tsfresh.module:function
# For example:
# console_scripts =
# fibonacci = tsfresh.skeleton:run
# as well as other entry_points.
[options.packages.find]
where = .
exclude =
tests*

[options.extras_require]
matrixprofile =
matrixprofile>=1.1.10,<2.0.0

docs =
Sphinx>=6.1.3
sphinx_rtd_theme>=1.2.0
b2luigi
docutils>=0.18.1

# Add here test requirements (semicolon/line-separated)
testing =
pytest>=4.4.0
pytest-cov>=2.6.1
pytest-xdist>=1.26.1
pytest-benchmark>=3.0.0
mock>=2.0.0
matplotlib>=2.0.0
seaborn>=0.7.1
ipython>=5.3.0
notebook>=4.4.1
pandas-datareader>=0.5.0
pre-commit

[options.entry_points]
console_scripts =
run_tsfresh = tsfresh.scripts.run_tsfresh:main


[files]
# Add here 'data_files', 'packages' or 'namespace_packages'.
# Additional data files are defined as key value pairs of source and target:
packages =
tsfresh
# data_files =
# share/tsfresh_docs = docs/*
[easy_install]
find_links = https://pypi.org/
index_url = https://pypi.org/simple

[extras]
# Add here additional requirements for extra features, like:
# PDF =
# ReportLab>=1.2
# RXP
[test]
# py.test options when running `python setup.py test`
# addopts = --verbose
extras = True

[tool:pytest]
# Options for py.test:
# Specify command line options as you would do when invoking py.test directly.
# e.g. --cov-report html (or xml) for html/xml output or --junitxml junit.xml
# in order to write a coverage file that can be read by Jenkins.
junit_family = xunit2
addopts =
--cov tsfresh --cov-report term-missing
--verbose
-n auto
testpaths = tests
filterwarnings =

[aliases]
dists = bdist_wheel
docs = build_sphinx

[bdist_wheel]
# Use this option if your package is pure-python
universal = 1

[build_sphinx]
Expand All @@ -76,12 +120,6 @@ build_dir = docs/_build
[pbr]
# Let pbr run sphinx-apidoc
autodoc_tree_index_modules = True
# autodoc_tree_excludes = ...
# Let pbr itself generate the apidoc
# autodoc_index_modules = True
# autodoc_exclude_modules = ...
# Convert warnings to errors
# warnerrors = True

[devpi:upload]
# Options for the devpi: PyPI server and packaging tool
Expand All @@ -93,3 +131,9 @@ with-docs = 0

[pycodestyle]
max-line-length = 120

[pyscaffold]
# PyScaffold's parameters when the project was created.
# This will be used when updating. Do not change!
version = 3.2.3
package = tsfresh
35 changes: 13 additions & 22 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,32 +1,23 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Setup file for tsfresh.
Use setup.cfg to configure your project.
This file was generated with PyScaffold 2.5.6, a tool that easily
puts up a scaffold for your new Python project. Learn more under:
http://pyscaffold.readthedocs.org/
This file was generated with PyScaffold 3.2.3.
PyScaffold helps you to put up the scaffold of your new Python project.
Learn more under: https://pyscaffold.org/
"""

import sys

from setuptools import find_packages, setup

with open("README.md") as f:
long_description = f.read()
from pkg_resources import VersionConflict, require
from setuptools import setup

with open("requirements.txt") as f:
requirements = [line for line in f if not line.startswith("#")]
try:
require("setuptools>=38.3")
except VersionConflict:
print("Error: version of setuptools is too old (<38.3)!")
sys.exit(1)

needs_sphinx = {"build_sphinx", "upload_docs"}.intersection(sys.argv)
sphinx = ["sphinx", "sphinx_rtd_theme"] if needs_sphinx else []

setup(
use_scm_version=True,
long_description=long_description,
long_description_content_type="text/markdown",
setup_requires=["setuptools_scm"] + sphinx,
packages=find_packages(exclude=["tests.*", "tests"]),
install_requires=requirements,
extras_require={"matrixprofile": ["matrixprofile>=1.1.10,<2.0.0"]},
)
if __name__ == "__main__":
setup(use_pyscaffold=True)
Loading

0 comments on commit 6991bc7

Please sign in to comment.