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 682256a
Show file tree
Hide file tree
Showing 29 changed files with 144 additions and 163 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 MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
include pyilcd/VERSION
include pyilcd/schemas/*.xsd
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
139 changes: 0 additions & 139 deletions setup.cfg

This file was deleted.

Loading

0 comments on commit 682256a

Please sign in to comment.