Skip to content

Commit b8c2c71

Browse files
committed
pyproject.toml and CONTRIBUTING.md
1 parent 36d05f2 commit b8c2c71

File tree

7 files changed

+183
-51
lines changed

7 files changed

+183
-51
lines changed

CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
# 1.6.1
2-
3-
- forward randome state to k-means to compute landmarks
4-
51
# v1.6.0
62

73
- use [PyNNDescent](https://github.com/lmcinnes/pynndescent) for faster nearest neighbor distance computation
84
- update deprecated `tol` argument of `jax.numpy.linalg.matrix_rank` to `rtol`
5+
- forward random state to k-means to compute landmarks
6+
- modernize build system using pyproject.toml instead of setup.py
97

108
# v1.5.0
119

CONTRIBUTING.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Contributing to Mellon
2+
3+
Thank you for your interest in contributing to Mellon!
4+
5+
## Development Environment
6+
7+
### Setting up with micromamba or conda
8+
9+
We recommend using micromamba or conda for your development environment:
10+
11+
```bash
12+
# Create development environment
13+
micromamba create -n mellon_dev python=3.9 -y
14+
micromamba activate mellon_dev
15+
16+
# Install in development mode with dev dependencies
17+
pip install -e ".[dev]"
18+
```
19+
20+
### Running Tests
21+
22+
```bash
23+
# Run all tests
24+
pytest
25+
26+
# Run tests with coverage report
27+
pytest --cov=mellon
28+
```
29+
30+
### Code Formatting
31+
32+
We use Black and isort for code formatting:
33+
34+
```bash
35+
# Format code with Black
36+
black mellon tests
37+
38+
# Sort imports with isort
39+
isort mellon tests
40+
```
41+
42+
### Type Checking
43+
44+
```bash
45+
# Run static type checking with mypy
46+
mypy mellon
47+
```
48+
49+
### Linting
50+
51+
```bash
52+
# Run flake8 for linting
53+
flake8 mellon tests
54+
```
55+
56+
## Building the Package
57+
58+
```bash
59+
# Build wheel
60+
python -m build --wheel
61+
62+
# Build source distribution
63+
python -m build --sdist
64+
```
65+
66+
## Documentation
67+
68+
To build the documentation:
69+
70+
```bash
71+
# Install docs dependencies
72+
pip install -e ".[docs]"
73+
74+
# Build documentation
75+
cd docs
76+
make html
77+
```
78+
79+
## Pull Request Process
80+
81+
1. Ensure your code passes all tests
82+
2. Update documentation where necessary
83+
3. Add an entry to CHANGELOG.md
84+
4. Submit a pull request
85+
86+
Thank you for helping improve Mellon!

MANIFEST.in

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include LICENSE
2+
include README.rst
3+
include CHANGELOG.md
4+
include CITATION.cff
5+
include pyproject.toml
6+
include pytest.ini
7+
8+
recursive-include tests *.py
9+
recursive-include docs *.py *.rst *.txt *.ico

pyproject.toml

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
[build-system]
2+
requires = ["setuptools>=42", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "mellon"
7+
version = "1.6.0"
8+
description = "Non-parametric density estimator."
9+
authors = [
10+
{name = "Setty Lab", email = "dominik.otto@gmail.com"}
11+
]
12+
readme = "README.rst"
13+
license = {text = "GNU General Public License v3.0"}
14+
classifiers = [
15+
"Intended Audience :: Science/Research",
16+
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
17+
]
18+
requires-python = ">=3.6"
19+
dependencies = [
20+
"jax",
21+
"jaxopt",
22+
"scikit-learn",
23+
"pynndescent",
24+
]
25+
26+
[project.urls]
27+
Homepage = "https://github.com/settylab/mellon"
28+
29+
[tool.setuptools]
30+
packages = ["mellon"]
31+
32+
[project.optional-dependencies]
33+
dev = [
34+
"black",
35+
"flake8",
36+
"isort",
37+
"mypy",
38+
"pytest",
39+
"pytest-cov",
40+
"typing-extensions",
41+
]
42+
docs = [
43+
"sphinxcontrib-autoprogram",
44+
"sphinxcontrib-napoleon",
45+
"sphinx-autodocgen",
46+
"sphinx-github-style>=1.2.2",
47+
"sphinx-mdinclude",
48+
"m2r2",
49+
"nbsphinx",
50+
"furo",
51+
"typing-extensions",
52+
"IPython",
53+
]
54+
55+
[project.scripts]
56+
mellon-test = "pytest:main"
57+
58+
[tool.pytest]
59+
testpaths = ["tests"]
60+
61+
[tool.black]
62+
line-length = 88
63+
target-version = ["py36", "py37", "py38", "py39"]
64+
include = '\.pyi?$'
65+
66+
[tool.isort]
67+
profile = "black"
68+
line_length = 88
69+
multi_line_output = 3
70+
71+
[tool.mypy]
72+
python_version = "3.9"
73+
warn_return_any = true
74+
warn_unused_configs = true
75+
disallow_untyped_defs = false
76+
disallow_incomplete_defs = false

readthedocs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ python:
1212
install:
1313
- requirements: docs/requirements.txt
1414
- method: pip
15-
path: .
15+
path: .
16+
extra_requirements:
17+
- docs

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.
1+
-e .

setup.py

Lines changed: 6 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,8 @@
1-
from setuptools import setup
2-
3-
# read the contents of your README file
4-
from pathlib import Path
5-
6-
this_directory = Path(__file__).parent
7-
8-
9-
def get_version(rel_path):
10-
for line in (this_directory / rel_path).read_text().splitlines():
11-
if line.startswith("__version__"):
12-
delim = '"' if '"' in line else "'"
13-
return line.split(delim)[1]
14-
else:
15-
raise RuntimeError("Unable to find version string.")
1+
"""
2+
This setup.py file is only for backward compatibility.
3+
The actual configuration is in pyproject.toml.
4+
"""
165

6+
from setuptools import setup
177

18-
setup(
19-
name="mellon",
20-
version=get_version("mellon/__init__.py"),
21-
description="Non-parametric density estimator.",
22-
url="https://github.com/settylab/mellon",
23-
author="Setty Lab",
24-
author_email="dominik.otto@gmail.com",
25-
license="GNU General Public License v3.0",
26-
packages=["mellon"],
27-
install_requires=[
28-
"jax",
29-
"jaxopt",
30-
"scikit-learn",
31-
"pynndescent",
32-
],
33-
extras_require={
34-
'dev': [
35-
'flake8',
36-
'pytest',
37-
'coverage',
38-
'typing-extensions'
39-
]
40-
},
41-
classifiers=[
42-
"Intended Audience :: Science/Research",
43-
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
44-
],
45-
long_description=(this_directory / "README.rst").read_text(),
46-
long_description_content_type="text/x-rst",
47-
)
8+
setup()

0 commit comments

Comments
 (0)