Skip to content

Commit

Permalink
Merge pull request #36 from jeanslack/builder
Browse files Browse the repository at this point in the history
Switch to hatchling  builder + fixes
  • Loading branch information
jeanslack authored Oct 22, 2024
2 parents c5e5764 + 0d7d53c commit 1a1768a
Show file tree
Hide file tree
Showing 10 changed files with 141 additions and 146 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
+--------------------------------+
October 22 2024 Version 1.0.25
+--------------------------------+

- Switched to hatchling as the default build backend which replaces setuptools.
- Fixed some lint warn/error (pylint + flake8).
- Changed info.py to about.py + code improvements.
- Removed setup.py file because it was obsolete.
- Removed MANIFEST.in file because it was obsolete.
- Minimum Python version fixed at v3.8 .

+--------------------------------+
January 07 2024 Version 1.0.23
+--------------------------------+
Expand Down
7 changes: 0 additions & 7 deletions MANIFEST.in

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# FFcuesplitter - FFmpeg-based audio splitter for CDDA images associated with .cue files .

[![Image](https://img.shields.io/static/v1?label=python&logo=python&message=3.7%20|%203.8%20|%203.9%20|%203.10%20|%203.11&color=blue)](https://www.python.org/downloads/)
[![Image](https://img.shields.io/static/v1?label=python&logo=python&message=3.8%20|%203.9%20|%203.10%20|%203.11%20|%203.12&color=blue)](https://www.python.org/downloads/)
[![Python application](https://github.com/jeanslack/FFcuesplitter/actions/workflows/CI.yml/badge.svg)](https://github.com/jeanslack/FFcuesplitter/actions/workflows/CI.yml)

FFcuesplitter is a multi-platform CUE sheet splitter entirely based on FFmpeg.
Expand Down Expand Up @@ -28,7 +28,7 @@ or from the [command line](https://github.com/jeanslack/FFcuesplitter#using-comm

## Requires

- Python >=3.7
- Python >=3.8
- [deflacue](https://pypi.org/project/deflacue/)
- [chardet](https://pypi.org/project/chardet/)
- [tqdm](https://pypi.org/project/tqdm/#description)
Expand Down
40 changes: 19 additions & 21 deletions ffcuesplitter/info.py → ffcuesplitter/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Writer: jeanslack <[email protected]>
license: GPL3
Copyright: (C) 2024 Gianluca Pernigotto <[email protected]>
Rev: Aug 12 2023
Rev: Oct 22 2024
####################################################################
This file is part of FFcuesplitter.
Expand All @@ -22,32 +22,30 @@
You should have received a copy of the GNU General Public License
along with FFcuesplitter. If not, see <http://www.gnu.org/licenses/>.
"""
__author__ = "Gianluca Pernigotto - Jeanslack"
__contact__ = '<[email protected]>'
__maintainer__ = "Gianluca Pernigotto - Jeanslack"
__maintainer_contact__ = "[email protected]"
__copyleft__ = '2024'
__version__ = '1.0.23'
__release__ = 'January 09 2024'
__appname__ = "FFcuesplitter"
__packagename__ = "ffcuesplitter"
__license__ = "GPL3 (Gnu Public License)"
__projecturl__ = "https://github.com/jeanslack/FFcuesplitter"
__githuburl__ = "https://github.com/jeanslack/FFcuesplitter"
__description__ = ("FFmpeg based audio splitter for CDDA images associated "
"with .cue files.")
__descriptionfull__ = """FFcuesplitter is a multi-platform CUE sheet splitter
AUTHOR = "Gianluca Pernigotto - Jeanslack"
CONTACT = '<[email protected]>'
MAINTAINER = "Gianluca Pernigotto - Jeanslack"
COPYLEFT = '2024'
VERSION = '1.0.25'
RELEASE = 'October 21 2024'
APPNAME = "FFcuesplitter"
PKGNAME = "ffcuesplitter"
LICENSE_NAME = "GPL3 (Gnu Public License)"
PROJECTURL = "https://github.com/jeanslack/FFcuesplitter"
GITHUBURL = "https://github.com/jeanslack/FFcuesplitter"
SHORT_DESCRIPT = ("FFmpeg based audio splitter for CDDA images associated "
"with .cue files.")
LONG_DESCRIPT = """FFcuesplitter is a multi-platform CUE sheet splitter
entirely based on FFmpeg. Splits big audio tracks and automatically embeds tags
using the information contained in the associated **"CUE"** sheet. It supports
multiple CUE sheet encodings and many input formats (due to FFmpeg), including
APE format, without need installing extra audio libs and packages. It has the
ability to accept both files and directories as input while also working in
recursive mode. Can be used both as a Python module or by command line."""
__license__ = "GPL3 (Gnu Public License)"
__licensefull__ = f"""
Copyright - {__copyleft__} {__author__}
Author and Developer: {__author__}
Mail: {__contact__}
SHORT_LICENSE = f"""
Copyright - {COPYLEFT} {AUTHOR}
Author and Developer: {AUTHOR}
Mail: {CONTACT}
FFcuesplitter is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion ffcuesplitter/cuesplitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def deflacue_object_handler(self):
raise FFCueSplitterError('No audio files found!')
continue

filename = (f"{sanitize(track[1].title)}") # titles to sanitize
filename = f"{sanitize(track[1].title)}" # titles to sanitize

data = {'FILE': str(track_file), **cd_info, **track[1].data}
data['TITLE'] = filename
Expand Down
3 changes: 1 addition & 2 deletions ffcuesplitter/ffprobe.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,4 @@ def ffprobe(filename, cmd='ffprobe', **kwargs):
except (OSError, FileNotFoundError) as excepterr:
raise FFProbeError(excepterr) from excepterr

else:
return json.loads(output)
return json.loads(output)
21 changes: 10 additions & 11 deletions ffcuesplitter/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
along with FFcuesplitter. If not, see <http://www.gnu.org/licenses/>.
"""
import argparse
from ffcuesplitter.info import (__appname__,
__description__,
__version__,
__release__,
)
from ffcuesplitter.about import (APPNAME,
SHORT_DESCRIPT,
VERSION,
RELEASE
)
from ffcuesplitter.str_utils import (msgdebug,
msgend,
msgcolor,
Expand All @@ -51,15 +51,15 @@ def main():
Defines and evaluates positional arguments
using the argparser module.
"""
parser = argparse.ArgumentParser(prog=__appname__,
description=__description__,
parser = argparse.ArgumentParser(prog=APPNAME,
description=SHORT_DESCRIPT,
# add_help=False,
)
parser.add_argument('--version',
help="Show the current version and exit.",
action='version',
version=(f"ffcuesplitter v{__version__} "
f"- {__release__}"),
version=(f"ffcuesplitter v{VERSION} "
f"- {RELEASE}"),
)
parser.add_argument('-i', '--input-fd',
metavar='FILENAMES DIRNAMES',
Expand Down Expand Up @@ -166,8 +166,7 @@ def main():
find = FileFinder(args.input_fd) # get all cue files
if args.recursive is True:
allfiles = find.find_files_recursively(suffix=('.cue', '.CUE'))

elif args.recursive is False:
else:
allfiles = find.find_files(suffix=('.cue', '.CUE'))

filelist = set(allfiles['FOUND']
Expand Down
16 changes: 8 additions & 8 deletions ffcuesplitter/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ def find_files_recursively(self, suffix: str = '') -> dict:
if os.path.splitext(files)[1] in suffix:
self.filtered.append(os.path.join(path, files))

return dict(FOUND=self.filtered,
DISCARDED=self.rejected,
INEXISTENT=self.nonexistent
)
return {"FOUND": self.filtered,
"DISCARDED": self.rejected,
"INEXISTENT": self.nonexistent
}
# -------------------------------------------------------------#

def find_files(self, suffix: str = '') -> dict:
Expand All @@ -278,8 +278,8 @@ def find_files(self, suffix: str = '') -> dict:
else:
self.nonexistent.append(dirs) # all non-existing files/dirs

return dict(FOUND=self.filtered,
DISCARDED=self.rejected,
INEXISTENT=self.nonexistent
)
return {"FOUND": self.filtered,
"DISCARDED": self.rejected,
"INEXISTENT": self.nonexistent
}
# ------------------------------------------------------------------------
89 changes: 89 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "ffcuesplitter"
dynamic = ["version"]
readme = "README.md"
requires-python = ">=3.8"
authors = [
{name = "Gianluca Pernigotto", email = "[email protected]"}
]
maintainers = [
{name = "Gianluca Pernigotto", email = "[email protected]"}
]
description = "FFmpeg-based audio splitter for CDDA images associated with .cue files ."
license = {text = "GNU General Public License v3 (GPLv3)"}
keywords = [
"ffcuesplitter",
"converter",
"audio splitter",
"ffmpeg"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: End Users/Desktop",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Natural Language :: English",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"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",
"Topic :: Multimedia :: Sound/Audio :: Conversion",
"Topic :: Utilities",
]
dependencies = [
"chardet>=4.0.0",
"tqdm>=4.38.0",
"deflacue>=2.0.1"
]
build = [
"build",
"hatchling",
"pip",
"six",
"wheel",
"setuptools",
]
[tool.hatch.version]
path = "ffcuesplitter/about.py"

[tool.hatch.build.targets.sdist]
include = [
"ffcuesplitter",
"tests",
"man",
"AUTHORS",
"BUGS",
"CHANGELOG",
"INSTALL",
"LICENSE",
"README.md", # already included as readme
"TODO",
"ffcuesplitter.py",
".gitignore", # already included by default, needed for auto-excludes
".flake8",
".pylintrc",
]
exclude = [
]
[tool.hatch.build.targets.wheel]
packages = ["ffcuesplitter"]

[tool.hatch.build.targets.wheel.shared-data]
"man/ffcuesplitter.1.gz" = "share/man/man1/ffcuesplitter.1.gz"
[project.scripts]
ffcuesplitter = "ffcuesplitter.main:main"

[project.urls]
Homepage = "https://github.com/jeanslack/FFcuesplitter"
Documentation = "https://github.com/jeanslack/FFcuesplitter#readme"
Wiki = "https://github.com/jeanslack/FFcuesplitter/wiki"
Tracker = "https://github.com/jeanslack/Videomass/issues"
94 changes: 0 additions & 94 deletions setup.py

This file was deleted.

0 comments on commit 1a1768a

Please sign in to comment.