Skip to content

Commit

Permalink
feat: config the project with pyproject.toml;
Browse files Browse the repository at this point in the history
  • Loading branch information
WenjieDu committed Jul 23, 2024
1 parent 05d7e59 commit a2f0ef2
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 122 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/publish_to_PyPI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,11 @@ jobs:
with:
python-version: '3.10'
check-latest: true
cache-dependency-path: |
requirements.txt

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
pip install -r requirements.txt
pip install build
- name: Fetch the test environment details
run: |
Expand All @@ -48,7 +45,7 @@ jobs:
- name: Build package
run: |
python -m build --no-isolation
python -m build
- name: Publish the new package to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.7
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ repos:
hooks:
- id: flake8
args: [
--max-line-length=120, # refer to setup.cfg
--max-line-length=120, # refer to pyproject.toml
--extend-ignore=E203, # why ignore E203? Refer to https://github.com/PyCQA/pycodestyle/issues/373
]
75 changes: 75 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
[build-system]
requires = ["setuptools>=71"]

[project]
name = "tsdb"
description = "TSDB (Time Series Data Beans): a Python toolbox helping load 172 open-source time-series datasets"
authors = [{ name = "Wenjie Du", email = "wenjay.du@gmail.com" }]
dynamic = ["version", "readme", "dependencies"]
license = { file = "LICENSE" }
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development :: Libraries :: Application Frameworks",
]
keywords = [
"data mining",
"time series",
"time-series analysis",
"time-series database",
"time-series datasets",
"database",
"datasets",
"dataset downloading",
"imputation",
"classification",
"forecasting",
"partially observed",
"irregularly sampled",
"partially-observed time series",
"incomplete time series",
"missing data",
"missing values",
"pypots",
]

[project.urls]
Source = "https://github.com/WenjieDu/TSDB"
Homepage = "https://pypots.com"
Documentation = "https://docs.pypots.com"
"Bug Tracker" = "https://github.com/WenjieDu/TSDB/issues"
Download = "https://github.com/WenjieDu/TSDB/archive/main.zip"

[tool.setuptools.packages.find]
exclude = [
"docs*",
"test*",
"dataset_profiles*",
]

[tool.setuptools.dynamic]
version = { attr = "tsdb.version.__version__" }
readme = { file = "README.md", content-type = "text/markdown" }
dependencies = { file = "requirements.txt" }

[tool.flake8]
# People may argue that coding style is personal. This may be true if the project is personal and one works like a
# hermit, but to PyPOTS and its community, the answer is NO.
# We use Black and Flake8 to lint code style and keep the style consistent across all commits and pull requests.
# Black only reformats the code, and Flake8 is necessary for checking for some other issues not covered by Black.

# The Black line length is default as 88, while the default of Flake8 is 79. However, considering our monitors are
# much more advanced nowadays, I extend the maximum line length to 120, like other project e.g. transformers. People
# who prefer the default setting can keep using 88 or 79 while coding. Please ensure your code lines not exceeding 120.
max-line-length = 120
# why ignore E203? Refer to https://github.com/PyCQA/pycodestyle/issues/373
extend-ignore = """
E203
"""
32 changes: 0 additions & 32 deletions setup.cfg

This file was deleted.

66 changes: 0 additions & 66 deletions setup.py

This file was deleted.

19 changes: 1 addition & 18 deletions tsdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,6 @@
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause

# TSDB version
#
# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
# Generic release markers:
# X.Y
# X.Y.Z # For bugfix releases
#
# Admissible pre-release markers:
# X.YaN # Alpha release
# X.YbN # Beta release
# X.YrcN # Release Candidate
# X.Y # Final release
#
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
__version__ = "0.6"

from .data_processing import (
CACHED_DATASET_DIR,
list,
Expand All @@ -38,6 +20,7 @@
migrate,
migrate_cache,
)
from .version import __version__

__all__ = [
"__version__",
Expand Down
24 changes: 24 additions & 0 deletions tsdb/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""
"""

# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause

# TSDB version
#
# PEP0440 compatible formatted version, see:
# https://www.python.org/dev/peps/pep-0440/
# Generic release markers:
# X.Y
# X.Y.Z # For bugfix releases
#
# Admissible pre-release markers:
# X.YaN # Alpha release
# X.YbN # Beta release
# X.YrcN # Release Candidate
# X.Y # Final release
#
# Dev branch marker is: 'X.Y.dev' or 'X.Y.devN' where N is an integer.
# 'X.Y.dev0' is the canonical version of 'X.Y.dev'
__version__ = "0.6.1"

0 comments on commit a2f0ef2

Please sign in to comment.