Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .flake8

This file was deleted.

67 changes: 48 additions & 19 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,58 @@ on:
types: [created]

jobs:
deploy:
ci-check:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.12"
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
- uses: actions/checkout@v4

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Install Package
version: "0.7.13"
python-version: ${{ matrix.python-version }}
enable-cache: true
cache-dependency-glob: "uv.lock"

- name: Install the project
run: uv sync --all-extras --dev

- name: Lint with ruff
run: |
pip install -e ".[dev, ruamel]"
uv run ruff check

- name: Test with pytest
run: |
pytest
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
uv run pytest


publish-pypi:
name: "Publish to PyPI"
needs:
- "ci-check"
runs-on: ubuntu-latest
environment: "publish-pypi"
permissions:
id-token: write # required for trusted publishing
steps:
- uses: actions/checkout@v4

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
version: "0.7.13"

- name: Install the project
run: |
uv sync --all-extras

- name: Publish the project to PyPI
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
uv publish
# NOTE: This works because of trusted publishing
39 changes: 20 additions & 19 deletions .github/workflows/python-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,33 @@ on:
branches: [main]

jobs:
build:
ci-check:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.8, 3.9]
deps:
- dev
python-version:
- "3.10"
- "3.12"
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- uses: actions/checkout@v4

- name: Install uv and set the python version
uses: astral-sh/setup-uv@v5
with:
version: "0.7.13"
python-version: ${{ matrix.python-version }}
- name: Install Package with dependencies ${{ matrix.deps }}
run: |
pip install -e ".[${{ matrix.deps }}]"
- name: Lint with flake8
enable-cache: true
cache-dependency-glob: "uv.lock"


- name: Install the project
run: uv sync --all-extras --dev

- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
uv run ruff check

- name: Test with pytest
run: |
pytest
# - name: Test with mypy
# run: |
# mypy -m tsdata
uv run pytest
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
__pycache__
**.ipynb_checkpoints

# setuptools files
# Build files
src/*.egg-info
/build
/dist

# uv-specific files
/uv.lock
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ The `tsdata` package itself contains a way of loading these into Pandas.

**NOTE**: The PyPI name is `py-tsdata` due to confict with a removed package.

**NOTE**: This package currently only includes the bare requirements.
However, I will keep adding data and functionality over time.

## Installing

You can install this as a regular Python package via pip:
Expand Down
8 changes: 0 additions & 8 deletions environment.yml

This file was deleted.

44 changes: 42 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
[project]
name = "py-tsdata"
version = "0.3.4"
description = "Time Series Datasets"
keywords = ["time series", "data", "pandas"]
readme = "README.md"
license = { file = "LICENSE" }
authors = [{ name = "NowanIlfideme", email = "git@nowan.dev" }]
classifiers = [
"Programming Language :: Python :: 3 :: Only",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Topic :: Software Development",
"Typing :: Typed",
]

# Requirements
requires-python = ">=3.10"
dependencies = ["pandas>=2.0.0"]

[project.optional-dependencies]

[dependency-groups]
dev = [
"mypy>=1.16.0",
"pandas-stubs>=2.2.3.250527",
"pytest>=8.4.0",
"ruff>=0.11.13",
]

[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
requires = ["uv_build>=0.7.13,<0.8"]
build-backend = "uv_build"

[tool.uv]
package = true
default-groups = ["dev"]

[tool.uv.build-backend]
module-name = "tsdata"
module-root = "src"
56 changes: 0 additions & 56 deletions setup.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions setup.py

This file was deleted.

10 changes: 3 additions & 7 deletions src/tsdata/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
"""Time Series Data package.
"""Time Series Data package."""

The version is managed by bump2version.
"""
__all__ = ["__version__"]

from pathlib import Path

__version__ = "0.3.4"
__root__ = Path(__file__).parent
from ._version import __version__
5 changes: 5 additions & 0 deletions src/tsdata/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Version package."""

from importlib.metadata import version as _getversion

__version__ = _getversion("py-tsdata")
2 changes: 2 additions & 0 deletions src/tsdata/py.typed
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This package includes type annotations
# See https://peps.python.org/pep-0561/
3 changes: 1 addition & 2 deletions src/tsdata/raw/fpp3/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
"""

from pathlib import Path
from typing import Dict

import pandas as pd

from ..registry import Loader, register_loader

__all__ = []
_funcs: Dict[str, Loader] = {}
_funcs: dict[str, Loader] = {}

for _filename in Path(__file__).parent.glob("*.csv"):
_name = _filename.stem
Expand Down
Loading
Loading