Skip to content

Commit

Permalink
migrate to hatch
Browse files Browse the repository at this point in the history
  • Loading branch information
slowkow committed Jul 4, 2024
1 parent 182a5c6 commit a770f2d
Show file tree
Hide file tree
Showing 11 changed files with 118 additions and 66 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# 0.0.10 - 2024-07-04

- Migrate to hatch to ease development and include multiple authors.
- Add @johnarevalo to the author list.

# 0.0.9 - 2022-11-23

- Stop excluding `README.md` from the build, because setup.py depends on this
Expand Down
65 changes: 65 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
We use [hatch] to develop harmonypy.

Copy the harmonypy code to your computer:

```
git clone https://github.com/slowkow/harmonpy
```

Then change to the newly created directory:

```
cd harmonypy
```

Install hatch:

```
pipx install hatch
```

Create a new environment just for harmonypy:

```
hatch env create
```

Once we have hatch and an environment, then we can enter a new shell:

```
hatch shell
```

In this environment, we can run tests:

```
hatch test
```

And we can also build the files needed for PyPI:

```
hatch build
```

We should double-check that the contents of the `.tar.gz` file do not include any files we do not want to publish:

```
tar tvf dist/harmonypy-0.0.10.tar.gz
-rw-r--r-- 0 0 0 97 Feb 1 2020 harmonypy-0.0.10/harmonypy/__init__.py
-rw-r--r-- 0 0 0 12783 Feb 1 2020 harmonypy-0.0.10/harmonypy/harmony.py
-rw-r--r-- 0 0 0 4559 Feb 1 2020 harmonypy-0.0.10/harmonypy/lisi.py
-rw-r--r-- 0 0 0 1824 Feb 1 2020 harmonypy-0.0.10/.gitignore
-rw-r--r-- 0 0 0 35149 Feb 1 2020 harmonypy-0.0.10/LICENSE
-rw-r--r-- 0 0 0 3126 Feb 1 2020 harmonypy-0.0.10/README.md
-rw-r--r-- 0 0 0 1026 Feb 1 2020 harmonypy-0.0.10/pyproject.toml
```

When we're ready, we can publish to PyPI:

```
hatch publish
```

[hatch]: https://hatch.pypa.io

2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
include README.md
prune data*
prune tests*
exclude publish_to_pypi.md
exclude MANIFEST.in
exclude Makefile
11 changes: 0 additions & 11 deletions Makefile

This file was deleted.

3 changes: 2 additions & 1 deletion harmonypy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from .harmony import Harmony, run_harmony
from .lisi import compute_lisi
from .version import __version__

__version__ = '0.0.10'
1 change: 0 additions & 1 deletion harmonypy/version.py

This file was deleted.

17 changes: 0 additions & 17 deletions publish_to_pypi.md

This file was deleted.

46 changes: 46 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[project]
name = "harmonypy"
dynamic = ["version"]
description = "A data integration algorithm."
readme = "README.md"
license = ""
requires-python = ">=3.6"
authors = [
{ name = "Kamil Slowikowski", email = "kslowikowski@gmail.com" },
{ name = "John Arevalo" }
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]
dependencies = [
"numpy",
"pandas",
"scikit-learn",
"scipy",
]

[project.urls]
Homepage = "https://github.com/slowkow/harmonypy"

[tool.hatch.version]
path = "harmonypy/__init__.py"

[tool.hatch.build.targets.sdist]
include = [
"/harmonypy",
]

[tool.hatch.envs.test]
dependencies = [
"pytest"
]
4 changes: 0 additions & 4 deletions requirements.txt

This file was deleted.

30 changes: 0 additions & 30 deletions setup.py

This file was deleted.

Empty file added tests/__init__.py
Empty file.

0 comments on commit a770f2d

Please sign in to comment.