Skip to content

Commit

Permalink
migrate to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
stefan6419846 committed Apr 11, 2024
1 parent b7bc25d commit d03d4f9
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Parse the metadata of `Cargo.toml` files.
* Allow setting the log level for the CLI.
* Add option to prefer/download source distributions from PyPI instead of wheels.
* Migrate from `setup.py` to `pyproject.toml`.

# Version 0.9.0 - 2024-03-23

Expand Down
88 changes: 84 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,96 @@
# Copyright (c) stefan6419846. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.

[build-system]
requires = [
'setuptools',
'wheel',
"setuptools",
"wheel"
]
build-backend = "setuptools.build_meta"

[project]
name = "license_tools"
description = "Collection of tools for working with Open Source licenses"
version = "0.9.0"
license = {text = "Apache-2.0"}
readme = {file = "README.md", content-type = "text/markdown"}
authors = [
{name = "stefan6419846"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development",
"Topic :: Utilities",
"Typing :: Typed",
]
keywords = [
"open source",
"license",
"package",
"dependency",
"licensing"
]
requires-python = ">=3.8, <4"
dependencies = [
"scancode-toolkit>=32.1.0",
"typecode-libmagic",
"joblib",
"fontTools[woff]",
"pip-licenses-lib",
"requests",
"tomli",
]

[project.urls]
Homepage = "https://github.com/stefan6419846/license_tools"
Documentation = "https://license-tools.readthedocs.io/"
Repository = "https://github.com/stefan6419846/license_tools"
Issues = "https://github.com/stefan6419846/license_tools/issues"
Changelog = "https://github.com/stefan6419846/license_tools/blob/main/CHANGELOG.md"

[project.optional-dependencies]
dev = [
"codespell",
"coverage",
"flake8",
"flake8-bugbear",
"pep8-naming",
"mypy",
"types-requests",
"importlib_resources; python_version < '3.9'",
]
extended_rpm = [
"rpmfile",
]
docs = [
"sphinx",
"furo",
]

[tool.setuptools]
include-package-data = true

[tool.setuptools.packages.find]
where = ["."]
include = [
"license_tools",
"license_tools.*"
]
namespaces = false

[tool.codespell]
check-hidden = true
skip = './.git*,./.mypy_cache/*,./todo/*'
skip = "./.git*,./.mypy_cache/*,./todo/*"

[tool.coverage.run]
branch = true
parallel = true # Due to `joblib` for `MainTestCase.test_retrieval`
source = [
'license_tools',
"license_tools",
]
4 changes: 2 additions & 2 deletions tests/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
)


SETUP_PATH = Path(__file__).parent.parent / "setup.py"
LICENSE_PATH = SETUP_PATH.parent / "LICENSE.txt"
SETUP_PATH = Path(__file__).parent / "files" / "setup.py"
LICENSE_PATH = Path(__file__).parent.parent / "LICENSE.txt"


TYPING_EXTENSIONS__4_8_0__WHEEL = Download(
Expand Down
File renamed without changes.
3 changes: 3 additions & 0 deletions tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import subprocess
import sys
import time
from pathlib import Path
from tempfile import TemporaryDirectory
from unittest import TestCase
Expand Down Expand Up @@ -77,6 +78,7 @@ def test_retrieval(self) -> None:
self.assertEqual(TYPING_EXTENSION_4_8_0__EXPECTED_OUTPUT, result.stdout.decode("UTF-8"))

def test_cargo_lock_download(self) -> None:
time.sleep(1)
with TemporaryDirectory() as target_directory, TemporaryDirectory() as source_directory:
cargo_lock = Path(source_directory) / "Cargo.lock"
cargo_lock.write_text(EXAMPLE_CARGO_LOCK_FILE)
Expand All @@ -100,6 +102,7 @@ def test_cargo_lock_download(self) -> None:
)

def test_logging(self) -> None:
time.sleep(1)
with TemporaryDirectory() as target_directory, TemporaryDirectory() as source_directory:
cargo_lock = Path(source_directory) / "Cargo.lock"
cargo_lock.write_text(EXAMPLE_CARGO_LOCK_FILE__ONE_PACKAGE_ONLY)
Expand Down

0 comments on commit d03d4f9

Please sign in to comment.