Skip to content
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

Transition from using setup.py to pyproject.toml to specify project metadata #766

Merged
merged 13 commits into from
Mar 5, 2024
Merged
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
2 changes: 2 additions & 0 deletions .github/workflows/readme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install invoke rundoc .
python -m pip install tomli
python -m pip install packaging
- name: Run the README.md
run: invoke readme
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,7 @@ coverage: ## check code coverage quickly with the default Python

.PHONY: dist
dist: clean ## builds source and wheel package
python setup.py sdist
python setup.py bdist_wheel
python rdt/transformers/addons/addons_setup.py
python -m build --wheel --sdist
ls -l dist

.PHONY: publish-confirm
Expand Down
138 changes: 138 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
[build-system]
requires = ['setuptools', 'wheel']
build-backend = 'setuptools.build_meta'

[project]
name = 'rdt'
description = 'Reversible Data Transforms'
authors = [{ name = 'DataCebo, Inc.', email = '[email protected]' }]
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: Free for non-commercial use',
'Natural Language :: English',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
]
keywords = ['machine learning', 'synthetic data generation', 'benchmark', 'generative models']
version = '1.9.3.dev0'
license = { text = 'BSL-1.1' }
requires-python = '>=3.8,<3.12'
readme = 'README.md'
dependencies = [
"numpy>=1.20.0,<2;python_version<'3.10'",
"numpy>=1.23.3,<2;python_version>='3.10'",
"pandas>=1.1.3;python_version<'3.10'",
"pandas>=1.3.4;python_version>='3.10' and python_version<'3.11'",
"pandas>=1.5.0;python_version>='3.11'",
"scipy>=1.5.4,<2;python_version<'3.10'",
"scipy>=1.9.2,<2;python_version>='3.10'",
"scikit-learn>=0.24,<2;python_version<'3.10'",
"scikit-learn>=1.1.0;python_version>='3.10' and python_version<'3.11'",
"scikit-learn>=1.1.3,<2;python_version>='3.11'",
'Faker>=17,<20',
]

[project.urls]
"Source Code"= "https://github.com/sdv-dev/RDT/"
"Issue Tracker" = "https://github.com/sdv-dev/RDT/issues"
"Changes" = "https://github.com/sdv-dev/RDT/blob/main/HISTORY.md"
"Twitter" = "https://twitter.com/sdv_dev"
"Chat" = "https://bit.ly/sdv-slack-invite"

[project.entry-points]
rdt = { main = 'rdt.cli.__main__:main' }

[project.optional-dependencies]
copulas = ['copulas>=0.10.0,<0.11',]
test = [
'rdt[copulas]',

'pytest>=3.4.2',
'pytest-cov>=2.6.0',
'jupyter>=1.0.0,<2',
'rundoc>=0.4.3,<0.5',
'pytest-subtests>=0.5,<1.0',
'pytest-runner >= 2.11.1',
'tomli>=2.0.0,<3',
]
dev = [
'rdt[test]',

# general
'bumpversion>=0.5.3,<0.6',
'pip>=9.0.1',
'watchdog>=0.8.3,<0.11',

# style check
'pycodestyle<2.8.0,>=2.7.0',
'pyflakes<2.4.0,>=2.3.0',
'flake8>=3.7.7,<4',
'flake8-absolute-import>=1.0,<2',
'flake8-builtins>=1.5.3,<1.6',
'flake8-comprehensions>=3.6.1,<3.7',
'flake8-debugger>=4.0.0,<4.1',
'flake8-docstrings>=1.5.0,<2',
'flake8-mock>=0.3,<0.4',
'flake8-variables-names>=0.0.4,<0.1',
'dlint>=0.11.0,<0.12', # code security addon for flake8
'flake8-fixme>=1.1.1,<1.2',
'flake8-eradicate>=1.1.0,<1.2',
'flake8-mutable>=1.2.0,<1.3',
'flake8-print>=4.0.0,<4.1',
'isort>=4.3.4,<5',
'pylint>=2.5.3,<3',
'pandas-vet>=0.2.3,<0.3',
'flake8-multiline-containers>=0.0.18,<0.1',
'flake8-pytest-style>=1.5.0,<2',
'flake8-quotes>=3.3.0,<4',
'flake8-expression-complexity>=0.0.9,<0.1',
'pep8-naming>=0.12.1,<0.13',
'pydocstyle>=6.1.1,<6.2',
'flake8-sfs>=0.0.3,<0.1',

# fix style issues
'autoflake>=1.1,<2',
'autopep8>=1.4.3,<1.6',

# distribute on PyPI
'twine>=1.10.0,<4',
'wheel>=0.30.0',

# Advanced testing
'coverage>=4.5.1,<6',
'tox>=2.9.1,<4',
'tabulate>=0.8.9,<1',

# Invoking test commands
'invoke'
]

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

[tool.setuptools.packages.find]
include = ['rdt', 'rdt.*']
namespaces = false

[tool.isort]
line_length = 99
lines_between_types = 0
multi_line_output = 4
not_skip = ['__init__.py']
use_parentheses = true

[tool.pydocstyle]
convention = 'google'
add-ignore = ['D107', 'D407', 'D417']

[tool.pytest.ini_options]
collect_ignore = ['pyproject.toml']

[tool.coverage.report]
exclude_lines = ['NotImplementedError()']

18 changes: 0 additions & 18 deletions rdt/transformers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@

import importlib
import inspect
import json
import sys
from collections import defaultdict
from copy import deepcopy
from functools import lru_cache
from pathlib import Path

from rdt.transformers.base import BaseMultiColumnTransformer, BaseTransformer
from rdt.transformers.boolean import BinaryEncoder
Expand Down Expand Up @@ -49,21 +46,6 @@
]


def _import_addons():
"""Import all the addon modules."""
addons_path = Path(__file__).parent / 'addons'
for addon_json_path in addons_path.glob('*/*.json'):
with open(addon_json_path, 'r', encoding='utf-8') as addon_json_file:
transformers = json.load(addon_json_file).get('transformers', [])
for transformer in transformers:
module = transformer.rsplit('.', 1)[0]
if module not in sys.modules:
importlib.import_module(module)


_import_addons()


def get_transformer_name(transformer):
"""Return the fully qualified path of the transformer.

Expand Down
37 changes: 0 additions & 37 deletions rdt/transformers/addons/README.md

This file was deleted.

105 changes: 0 additions & 105 deletions rdt/transformers/addons/addons_setup.py

This file was deleted.

7 changes: 0 additions & 7 deletions rdt/transformers/addons/identity/__init__.py

This file was deleted.

6 changes: 0 additions & 6 deletions rdt/transformers/addons/identity/config.json

This file was deleted.

44 changes: 0 additions & 44 deletions rdt/transformers/addons/identity/identity.py

This file was deleted.

Loading
Loading