Skip to content

Commit

Permalink
Switched to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
sami-m-g committed Mar 28, 2024
1 parent 3fa37bf commit 7bcc14f
Show file tree
Hide file tree
Showing 27 changed files with 144 additions and 23 deletions.
18 changes: 13 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,22 @@ repos:
# --remove-unused-variables,
# ]

- repo: https://github.com/john-hen/Flake8-pyproject
rev: 1.2.3
hooks:
- id: Flake8-pyproject

- repo: https://github.com/pycqa/isort
rev: 5.11.5
rev: 5.13.2
hooks:
- id: isort
args: [--settings-path=pyproject.toml]

- repo: https://github.com/psf/black
rev: 22.12.0
rev: 24.1.1
hooks:
- id: black
language_version: python3
args: [--config=pyproject.toml]

## If like to embrace black styles even in the docs:
# - repo: https://github.com/asottile/blacken-docs
Expand All @@ -47,11 +53,13 @@ repos:
# additional_dependencies: [black]

- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
## You can add flake8 plugins via `additional_dependencies`:
additional_dependencies: [Flake8-pyproject]
# You can add flake8 plugins via `additional_dependencies`:
# additional_dependencies: [flake8-bugbear]

- repo: local
hooks:
- id: pylint
Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [6.3.1] - 2024-03-28

### Fixed
- Packaging issues

## [6.3.0] - 2023-09-26

### Added
Expand Down
1 change: 0 additions & 1 deletion pyilcd/VERSION

This file was deleted.

4 changes: 3 additions & 1 deletion pyilcd/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""pyilcd."""

from .config import Defaults
from .contact_dataset import ContactDataSet
from .core import (
Expand Down Expand Up @@ -45,7 +46,8 @@
from .process_dataset import ProcessDataSet
from .source_dataset import SourceDataSet
from .unit_group_dataset import UnitGroupDataSet
from .version import __version__

__version__ = "6.3.1"

__all__ = (
"__version__",
Expand Down
1 change: 1 addition & 0 deletions pyilcd/common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Common custom ILCD Python classes."""

from datetime import datetime
from typing import List

Expand Down
1 change: 1 addition & 0 deletions pyilcd/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Defaults configuration."""

import configparser
import os
from dataclasses import dataclass
Expand Down
1 change: 1 addition & 0 deletions pyilcd/contact_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom ILCD Python classes for ContactDataSet of ILCD schema."""

from typing import List

from lxml import etree
Expand Down
1 change: 1 addition & 0 deletions pyilcd/core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Core ILCD module containing parsing and saving functionalities."""

from io import StringIO
from pathlib import Path
from typing import Dict, List, Tuple, Union
Expand Down
1 change: 1 addition & 0 deletions pyilcd/flow_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom ILCD Python classes for FlowDataSet of ILCD schema."""

from typing import List

from lxml import etree
Expand Down
1 change: 1 addition & 0 deletions pyilcd/flow_property_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom ILCD Python classes for FlowDataSet of ILCD schema."""

from typing import List

from lxml import etree
Expand Down
1 change: 1 addition & 0 deletions pyilcd/helpers.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Internal helper classes."""

from typing import Callable, Optional

from lxmlh import create_attribute, create_attribute_list, create_element_text
Expand Down
1 change: 1 addition & 0 deletions pyilcd/process_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom ILCD Python classes for ProcessDataSet of ILCD schema."""

from typing import List

from lxml import etree
Expand Down
1 change: 1 addition & 0 deletions pyilcd/source_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom ILCD Python classes for SourceDataSet of ILCD schema."""

from typing import List

from lxml import etree
Expand Down
1 change: 1 addition & 0 deletions pyilcd/unit_group_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Custom ILCD Python classes for UnitGroupDataSet of ILCD schema."""

from typing import List

from lxml import etree
Expand Down
15 changes: 0 additions & 15 deletions pyilcd/version.py

This file was deleted.

103 changes: 102 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,104 @@
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=68.0"]
build-backend = "setuptools.build_meta"

[project]
name = "pyilcd"
authors = [
{ name="Mina Sami", email="[email protected]" }
]
maintainers = [
{ name="Mina Sami", email="[email protected]" }
]
description = "A Python package that converts ILCD XML formats to their Python equivalents and export the same data back to XML."
readme = "README.md"
dynamic = ["version"]
# Add here all kinds of additional classifiers as defined under
# https://pypi.org/classifiers/
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"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",
"Natural Language :: English",
"Operating System :: OS Independent",
]
requires-python = ">=3.8"
dependencies = [
"lxml==4.9.2",
"lxmlh>=1.2.0",
"pycasreg==0.1.0",
]

[project.urls]
source = "https://github.com/sami-m-g/pyilcd"
homepage = "https://github.com/sami-m-g/pyilcd"
tracker = "https://github.com/sami-m-g/pyilcd/issues"

[project.optional-dependencies]
# Getting recursive dependencies to work is a pain, this
# seems to work, at least for now
testing = [
"pyilcd",
"pytest",
"pytest-cov",
"python-coveralls"
]
dev = [
"build",
"pre-commit",
"pylint",
"pytest",
"pytest-cov",
"pytest-randomly",
"setuptools",
"sphinx",
"sphinx-rtd-theme",
]

[tool.setuptools]
license-files = ["LICENSE"]
include-package-data = true
packages = ["pyilcd"]

[tool.setuptools.dynamic]
version = {attr = "pyilcd.__version__"}

[tool.pytest.ini_options]
addopts = "--cov pyilcd --cov-report term-missing --verbose"
norecursedirs = [
"dist",
"build",
".tox"
]
testpaths = ["tests/*.py"]

[tool.flake8]
# Some sane defaults for the code style checker flake8
max_line_length = 88
extend_ignore = ["E203", "W503"]
# ^ Black-compatible
# E203 and W503 have edge cases handled by black
exclude = [
".tox",
"build",
"dist",
".eggs",
"docs/conf.py",
]

[tool.black]
line-length = 88

[tool.isort]
profile = "black"
line_length = 88
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
1 change: 1 addition & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test suite for the pyilcd package."""

from pathlib import Path

DIR_DATA = Path(__file__).parents[1] / "data"
Expand Down
1 change: 1 addition & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Fixtures for pyilcd"""

import os
import zipfile

Expand Down
1 change: 1 addition & 0 deletions tests/test_common.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for the __common__ module."""

from pyilcd.common import (
Category,
Class,
Expand Down
1 change: 1 addition & 0 deletions tests/test_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for the __config__ module."""

import os
from pathlib import Path

Expand Down
1 change: 1 addition & 0 deletions tests/test_contact_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for the __contact_dataset__ module."""

from pyilcd.common import ClassificationInformation, GlobalReference
from pyilcd.contact_dataset import ContactDataSet, DataEntryBy

Expand Down
1 change: 1 addition & 0 deletions tests/test_core.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for the __core__ module."""

import os
import tempfile
from io import StringIO
Expand Down
1 change: 1 addition & 0 deletions tests/test_flow_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for the __flow_dataset__ module."""

from pyilcd.common import GlobalReference
from pyilcd.flow_dataset import (
ComplianceDeclarations,
Expand Down
1 change: 1 addition & 0 deletions tests/test_flow_property_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for the __flow_property_dataset__ module."""

from pyilcd.common import ClassificationInformation, GlobalReference
from pyilcd.flow_property_dataset import (
ComplianceDeclarations,
Expand Down
1 change: 1 addition & 0 deletions tests/test_process_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for the __process_dataset__ module."""

from pyilcd.common import ClassificationInformation, GlobalReference
from pyilcd.process_dataset import (
Allocation,
Expand Down
1 change: 1 addition & 0 deletions tests/test_source_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for the __contact_dataset__ module."""

from pyilcd.common import ClassificationInformation, GlobalReference
from pyilcd.source_dataset import DataEntryBy, ReferenceToDigitalFile, SourceDataSet

Expand Down
1 change: 1 addition & 0 deletions tests/test_unit_group_dataset.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Test cases for the __unit_group_dataset__ module."""

from pyilcd.common import ClassificationInformation, GlobalReference
from pyilcd.unit_group_dataset import (
DataEntryBy,
Expand Down

0 comments on commit 7bcc14f

Please sign in to comment.