Skip to content

Commit ae0e2e3

Browse files
portellaarenovate[bot]fabclmntazory-ydata
authored
chore(setup): comply build process with latest changes to pypi (#1731)
* chore(actions): update dependency python to 3.13 * chore: fix linting errors * fix: typing annotations * fix: fix import linting error * fix: ignore linter * chore: ignore mypy linter for some cases * fix(linting): code formatting * chore: create basesummarizer as a variable * chore: mypy type aliases * chore: fix typealias for older python versions * fix(linting): code formatting * chore: ignore F821 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Fabiana <[email protected]> Co-authored-by: Azory YData Bot <[email protected]>
1 parent 3d5301d commit ae0e2e3

26 files changed

+118
-94
lines changed

.github/workflows/pull-request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
- name: Set up Python 3.11
4141
uses: actions/setup-python@v5
4242
with:
43-
python-version: "3.13"
43+
python-version: '3.11'
4444

4545
- uses: actions/cache@v4
4646
name: Cache pip dependencies
@@ -52,7 +52,7 @@ jobs:
5252
5353
- name: Install pip dependencies
5454
run: |
55-
python -m pip install --upgrade pip setuptools
55+
python -m pip install --upgrade pip
5656
python -m pip install ".[dev,test]"
5757
5858
- name: Install pre-commit hooks
@@ -93,7 +93,7 @@ jobs:
9393
- name: Setup Python 3.11
9494
uses: actions/setup-python@v5
9595
with:
96-
python-version: "3.13"
96+
python-version: '3.11'
9797

9898
- name: Cache pip dependencies
9999
id: cache
@@ -105,7 +105,7 @@ jobs:
105105
- name: Install dependencies
106106
run: |
107107
python -m pip install --upgrade pip
108-
python -m pip install ".[dev,test,docs]"
108+
python -m pip install ".[docs]"
109109
110110
- name: Install the package
111111
run: make install

.github/workflows/release.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ jobs:
8080
name: built-artifacts
8181
path: dist/
8282

83-
- uses: pypa/gh-action-pypi-publish@v1.12.4
83+
- uses: pypa/gh-action-pypi-publish@release/v1
8484
with:
85-
user: __token__
86-
password: ${{ secrets.PYPI_API_TOKEN }}
85+
packages-dir: dist/

MANIFEST.in

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ include requirements*.txt
44
# Include license, Readme, etc.
55
include LICENSE
66
include *.md
7-
include mypy.ini
8-
include src/ydata_profiling/py.typed
97

108
# Templates and static resources
119
recursive-include src/ydata_profiling/report/presentation/flavours/html/templates *.html *.js *.css
@@ -20,7 +18,7 @@ recursive-include venv *.yml
2018
exclude .pre-commit-config.yaml
2119
exclude commitlint.config.js
2220
exclude .releaserc.json
23-
include Makefile make.bat
21+
exclude Makefile make.bat
2422
exclude docs examples tests docsrc .devcontainer
2523
recursive-exclude docs *
2624
recursive-exclude docsrc *

pyproject.toml

Lines changed: 50 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
[build-system]
2-
requires = ["setuptools"]
32
build-backend = "setuptools.build_meta"
3+
requires = [
4+
"setuptools>=72.0.0,<80.0.0",
5+
"setuptools-scm>=8.0.0,<9.0.0",
6+
"wheel>=0.38.4,<1.0.0"
7+
]
8+
9+
[packaging]
10+
package_name = "ydata-profiling"
411

512
[project]
613
name = "ydata-profiling"
14+
requires-python = ">=3.7,<3.13"
715
authors = [
8-
{name = "YData Labs Inc", email = "[email protected]"},
16+
{name = "YData Labs Inc", email = "[email protected]"}
917
]
10-
description="Generate profile report for pandas DataFrame"
18+
description = "Generate profile report for pandas DataFrame"
19+
keywords = ["pandas", "data-science", "data-analysis", "python", "jupyter", "ipython"]
1120
readme = "README.md"
12-
requires-python=">=3.7, <3.13"
13-
keywords=["pandas", "data-science", "data-analysis", "python", "jupyter", "ipython"]
14-
license = {text = "MIT"}
15-
classifiers=[
21+
license = {file = "LICENSE.md"}
22+
classifiers = [
1623
"Development Status :: 5 - Production/Stable",
1724
"Topic :: Software Development :: Build Tools",
1825
"License :: OSI Approved :: MIT License",
@@ -63,10 +70,11 @@ dependencies = [
6370
"numba>=0.56.0, <1",
6471
]
6572

66-
dynamic = ["version"]
73+
dynamic = [
74+
"version",
75+
]
6776

6877
[project.optional-dependencies]
69-
# dependencies for development and testing
7078
dev = [
7179
"black>=20.8b1",
7280
"isort>=5.0.7",
@@ -80,6 +88,22 @@ dev = [
8088
"sphinx-multiversion>=0.2.3",
8189
"autodoc_pydantic",
8290
]
91+
92+
docs = [
93+
"mkdocs>=1.6.0,<1.7.0",
94+
"mkdocs-material>=9.0.12,<10.0.0",
95+
"mkdocs-material-extensions>=1.1.1,<2.0.0",
96+
"mkdocs-table-reader-plugin<=2.2.0",
97+
"mike>=2.1.1,<2.2.0",
98+
"mkdocstrings[python]>=0.20.0,<1.0.0",
99+
"mkdocs-badges",
100+
]
101+
102+
notebook = [
103+
"jupyter>=1.0.0",
104+
"ipywidgets>=7.5.1",
105+
]
106+
83107
# this provides the recommended pyspark and pyarrow versions for spark to work on pandas-profiling
84108
# note that if you are using pyspark 2.3 or 2.4 and pyarrow >= 0.15, you might need to
85109
# set ARROW_PRE_0_15_IPC_FORMAT=1 in your conf/spark-env.sh for toPandas functions to work properly
@@ -90,6 +114,7 @@ spark = [
90114
"numpy>=1.16.0,<1.24",
91115
"visions[type_image_path]>=0.7.5, <0.7.7",
92116
]
117+
93118
test = [
94119
"pytest",
95120
"coverage>=6.5, <8",
@@ -100,35 +125,29 @@ test = [
100125
"twine>=3.1.1",
101126
"kaggle",
102127
]
103-
notebook = [
104-
"jupyter>=1.0.0",
105-
"ipywidgets>=7.5.1",
106-
]
107-
docs = [
108-
"mkdocs>=1.6.0,<1.7.0",
109-
"mkdocs-material>=9.0.12,<10.0.0",
110-
"mkdocs-material-extensions>=1.1.1,<2.0.0",
111-
"mkdocs-table-reader-plugin<=2.2.0",
112-
"mike>=2.1.1,<2.2.0",
113-
"mkdocstrings[python]>=0.20.0,<1.0.0",
114-
"mkdocs-badges",
115-
]
128+
116129
unicode= [
117130
"tangled-up-in-unicode==0.2.0",
118131
]
119132

120-
[tool.setuptools.packages.find]
121-
where = ["src"]
133+
[project.urls]
134+
Homepage = "https://ydata.ai"
135+
Repository = "https://github.com/ydataai/ydata-profiling"
122136

123-
[tool.setuptools.package-data]
124-
ydata_profiling = ["py.typed"]
137+
[project.scripts]
138+
ydata_profiling = "ydata_profiling.controller.console:main"
139+
pandas_profiling = "ydata_profiling.controller.console:main"
140+
141+
# setuptools relative
125142

126143
[tool.setuptools]
127144
include-package-data = true
128145

129-
[project.scripts]
130-
ydata_profiling = "ydata_profiling.controller.console:main"
131-
pandas_profiling = "ydata_profiling.controller.console:main"
146+
[tool.setuptools.package-data]
147+
ydata_profiling = ["py.typed"]
132148

133-
[project.urls]
134-
homepage = "https://github.com/ydataai/ydata-profiling"
149+
[tool.distutils.bdist_wheel]
150+
universal = true
151+
152+
[tool.setuptools.package-dir]
153+
"" = "src"

setup.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
# Read the contents of README file
66
source_root = Path(".")
7-
with (source_root / "README.md").open(encoding="utf-8") as f:
8-
long_description = f.read()
97

108
try:
119
version = (source_root / "VERSION").read_text().rstrip("\n")
@@ -17,7 +15,4 @@
1715

1816
setup(
1917
version=version,
20-
long_description=long_description,
21-
long_description_content_type="text/markdown",
22-
options={"bdist_wheel": {"universal": True}},
2318
)

src/ydata_profiling/model/correlations.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
# mypy: ignore-errors
2+
13
"""Correlations between variables."""
4+
25
import warnings
36
from typing import Dict, List, Optional, Sized
47

@@ -20,16 +23,16 @@ def __init__(self, df: Sized):
2023
"""Determine backend once and store it for all correlation computations."""
2124
if isinstance(df, pd.DataFrame):
2225
from ydata_profiling.model.pandas import (
23-
correlations_pandas as correlation_backend, #type: ignore
26+
correlations_pandas as correlation_backend, # type: ignore
2427
)
2528
else:
2629
from ydata_profiling.model.spark import (
27-
correlations_spark as correlation_backend, # type: ignore
30+
correlations_spark as correlation_backend, # type: ignore
2831
)
2932

3033
self.backend = correlation_backend
3134

32-
def get_method(self, method_name: str):
35+
def get_method(self, method_name: str): # noqa: ANN201
3336
"""Retrieve the appropriate correlation method class from the backend."""
3437
if hasattr(self.backend, method_name):
3538
return getattr(self.backend, method_name)

src/ydata_profiling/model/dataframe.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@
33

44
import pandas as pd
55

6+
from ydata_profiling.config import Settings
7+
from ydata_profiling.model.pandas.dataframe_pandas import pandas_preprocess
8+
69
spec = importlib.util.find_spec("pyspark")
710
if spec is None:
811
from typing import TypeVar
912

1013
sparkDataFrame = TypeVar("sparkDataFrame")
1114
else:
1215
from pyspark.sql import DataFrame as sparkDataFrame # type: ignore
13-
from ydata_profiling.model.spark.dataframe_spark import spark_preprocess
1416

15-
from ydata_profiling.config import Settings
16-
from ydata_profiling.model.pandas.dataframe_pandas import pandas_preprocess
17+
from ydata_profiling.model.spark.dataframe_spark import spark_preprocess
1718

1819

1920
def preprocess(config: Settings, df: Any) -> Any:

src/ydata_profiling/model/describe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
def describe(
3131
config: Settings,
32-
df: Union[pd.DataFrame, "pyspark.sql.DataFrame"], # type: ignore
32+
df: Union[pd.DataFrame, "pyspark.sql.DataFrame"], # type: ignore[name-defined] # noqa: F821
3333
summarizer: BaseSummarizer,
3434
typeset: VisionsTypeset,
3535
sample: Optional[dict] = None,

src/ydata_profiling/model/handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ def compose(functions: Sequence[Callable]) -> Callable:
1515
:return: combined function applying all functions in order.
1616
"""
1717

18-
def composed_function(*args):
18+
def composed_function(*args) -> List[Any]:
1919
result = args # Start with the input arguments
2020
for func in functions:
2121
result = func(*result) if isinstance(result, tuple) else func(result)
22-
return result
22+
return result # type: ignore
2323

24-
return composed_function
24+
return composed_function # type: ignore
2525

2626

2727
class Handler:

src/ydata_profiling/model/pandas/dataframe_pandas.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import warnings
2-
31
import pandas as pd
42

53
from ydata_profiling.config import Settings

0 commit comments

Comments
 (0)