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

Switch to modern python packaging #406

Merged
merged 2 commits into from
Feb 25, 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
6 changes: 2 additions & 4 deletions .github/workflows/python_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,11 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
pip install .
pip install .[test]

- name: Test with pytest
run: |
pytest --cov --cov-report=xml --cov-config=setup.cfg --verbose
pytest --cov --cov-report=xml --verbose

- name: Build docs
if: ${{ matrix.platform == 'ubuntu-latest' && matrix.python-version == 3.9 }}
Expand Down
32 changes: 1 addition & 31 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,36 +1,6 @@
# Add README, LICENSE and requirements :
include README.rst
include LICENSE
include requirements.txt

# Add datasets .csv files
include pingouin/datasets/ancova.csv
include pingouin/datasets/anova.csv
include pingouin/datasets/anova2.csv
include pingouin/datasets/anova2_unbalanced.csv
include pingouin/datasets/anova3.csv
include pingouin/datasets/anova3_unbalanced.csv
include pingouin/datasets/blandaltman.csv
include pingouin/datasets/chi2_independence.csv
include pingouin/datasets/chi2_mcnemar.csv
include pingouin/datasets/circular.csv
include pingouin/datasets/cochran.csv
include pingouin/datasets/cronbach_alpha.csv
include pingouin/datasets/cronbach_wide_missing.csv
include pingouin/datasets/datasets.csv
include pingouin/datasets/icc.csv
include pingouin/datasets/mediation.csv
include pingouin/datasets/mixed_anova.csv
include pingouin/datasets/mixed_anova_unbalanced.csv
include pingouin/datasets/multivariate.csv
include pingouin/datasets/pairwise_corr.csv
include pingouin/datasets/pairwise_tests.csv
include pingouin/datasets/pairwise_tests_missing.csv
include pingouin/datasets/partial_corr.csv
include pingouin/datasets/penguins.csv
include pingouin/datasets/rm_anova.csv
include pingouin/datasets/rm_anova2.csv
include pingouin/datasets/rm_anova_wide.csv
include pingouin/datasets/rm_corr.csv
include pingouin/datasets/rm_missing.csv
include pingouin/datasets/tips.csv
recursive-include src/pingouin/datasets *.csv
13 changes: 13 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ New releases are frequent so always make sure that you have the latest version:

pip install --upgrade pingouin

Development
-----------

To build and install from source, clone this repository or download the source archive and decompress the files

.. code-block:: shell

cd pingouin
python -m build # optional, build a wheel and sdist
pip install . # install the package
pip install --editable . # or editable install
pytest # test the package

Quick start
============

Expand Down
119 changes: 118 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,121 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "pingouin"
description = "Pingouin: statistical package for Python"
authors = [
{name = "Raphael Vallat", email = "raphaelvallat9@gmail.com"},
]
dependencies = [
"matplotlib",
"numpy",
"pandas>=1.5",
"pandas_flavor",
"scikit-learn>=1.2",
"scipy",
"seaborn",
"statsmodels",
"tabulate",
]
requires-python = ">=3.8"
readme = "README.rst"
license = {text = "GPL-3.0"}
maintainers = [
{name = "Raphael Vallat", email = "raphaelvallat9@gmail.com"},
]
dynamic = ["version"]
classifiers = [
"Intended Audience :: Science/Research",
"Operating System :: MacOS",
"Operating System :: POSIX",
"Operating System :: Unix",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Scientific/Engineering :: Mathematics",
]

[project.optional-dependencies]
test = [
"pytest>=6",
"pytest-cov",
"codecov",
"openpyxl",
"mpmath",
# Ensure coverage is new enough for `source_pkgs`.
"coverage[toml]>=5.3",
]

[project.urls]
Homepage = "https://pingouin-stats.org/index.html"
Downloads = "https://github.com/raphaelvallat/pingouin/"

[tool.setuptools]
py-modules = ["pingouin"]
include-package-data = true

[tool.setuptools.package-data]
pingouin = [
"datasets/*.csv",
getzze marked this conversation as resolved.
Show resolved Hide resolved
]

[tool.setuptools.packages.find]
namespaces = false
where = ["src"]

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

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "--showlocals --durations=10 --maxfail=2 --cov"
doctest_optionflags= ["NORMALIZE_WHITESPACE", "IGNORE_EXCEPTION_DETAIL"]
filterwarnings = [
"ignore::UserWarning",
"ignore::RuntimeWarning",
"ignore::FutureWarning",
]
markers = ["slow"]

[tool.coverage.run]
branch = true
omit = [
"*/setup.py",
"*/examples/*",
"*/tests/*",
"*/datasets/*",
]
source_pkgs = ["pingouin"]

[tool.coverage.paths]
source = ["src"]

[tool.coverage.report]
show_missing = true
# sort = "Cover"

[tool.black]
line-length = 100
target-version = ['py311']
include = '\.pyi?$'
include = '\.pyi?$'

[tool.flake8]
# W605 : bug when math equation in numpydoc
# W503, W504 : line-break with math operator
# E203: E203 whitespace before ':', not compatible with Black
# DXXX: Docstring related
max-line-length = 100
ignore = ["N806", "N803", "W503", "W504", "W605", "D100", "D200", "D205", "D301", "D400", "D401", "E203"]
exclude = [
".git",
"__pycache__",
"docs",
"build",
"__init__.py",
"examples",
"setup.py",
]
statistics = true
6 changes: 0 additions & 6 deletions requirements-test.txt

This file was deleted.

9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.

47 changes: 0 additions & 47 deletions setup.cfg

This file was deleted.

78 changes: 0 additions & 78 deletions setup.py

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading