Skip to content

[WIP] New package structure #145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
47 changes: 47 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# This workflow builds and publishes the package to PyPI when a tag is pushed

name: Publish Python Package

on:
push:
tags:
- 'v*' # Trigger on tags starting with 'v'

jobs:
deploy:
runs-on: ubuntu-latest

# Grant GITHUB_TOKEN the permissions required to create a release
permissions:
contents: read
id-token: write # Required for trusted publishing

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x' # Use a recent Python version for building

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine

- name: Build package
run: python -m build

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
# No API token needed if using trusted publishing
# with:
# password: ${{ secrets.PYPI_API_TOKEN }} # Use an API Token if not using Trusted Publishing

# Optional: Create a GitHub Release
# - name: Create GitHub Release
# uses: softprops/action-gh-release@v1
# with:
# files: dist/*
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 1 addition & 2 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install -e .
pip install .[dev]
- name: Test with pytest
run: |
pytest
5 changes: 0 additions & 5 deletions publish.sh

This file was deleted.

74 changes: 74 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "livelossplot"
dynamic = ["version"] # Version is read from version.py via setuptools config
description = "Live training loss plot in Jupyter Notebook for Keras, PyTorch and others."
readme = "README.md"
requires-python = ">=3.7"
license = {text = "MIT"}
keywords = ["keras", "pytorch", "plot", "chart", "deep-learning"]
authors = [
{name = "Piotr Migdał", email = "[email protected]"}
]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Jupyter",
"Intended Audience :: Developers",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Visualization",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = [
'ipython==7.*; python_version<"3.8"',
'matplotlib',
'bokeh',
'numpy<1.22; python_version<"3.8"',
]

[project.urls]
Homepage = "https://github.com/stared/livelossplot"

[project.optional-dependencies]
dev = [
"pytest",
"flake8",
"twine",
"wheel",
"build",
# Add other dev dependencies if needed (e.g., from the old requirements-dev.txt)
]

[tool.setuptools.dynamic]
# Read version from livelossplot/version.py
version = {attr = "livelossplot.version.__version__"}

[tool.setuptools.packages.find]
# Look for packages in the root directory (no src layout)
where = ["."]

[tool.flake8]
exclude = ".git,*migrations*,build*,old*,dist"
max-line-length = 120

[tool.yapf]
based_on_style = "facebook"
column_limit = 120

# --- Add configuration for tools like flake8 if desired ---
# Example: [tool.flake8]
# ignore = "E501,W503"
# max-line-length = 88
# exclude = ".git,__pycache__,build,dist"
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

7 changes: 0 additions & 7 deletions setup.cfg

This file was deleted.

58 changes: 0 additions & 58 deletions setup.py

This file was deleted.

Loading