diff --git a/CHANGELOG.md b/CHANGELOG.md index 734f007..84ade06 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a272443 --- /dev/null +++ b/CONTRIBUTING.md @@ -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 + diff --git a/MANIFEST.in b/MANIFEST.in index 9f203e7..1e858e1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,4 @@ include README.md prune data* prune tests* -exclude publish_to_pypi.md exclude MANIFEST.in -exclude Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 138c474..0000000 --- a/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -.PHONY: clean all setup - -all: clean - python3 setup.py sdist bdist_wheel - -setup: requirements.txt - pip install -r requirements.txt - -clean: - rm -rf __pycache__ build *.egg-info .pytest_cache - diff --git a/harmonypy/__init__.py b/harmonypy/__init__.py index c2993af..df4882b 100644 --- a/harmonypy/__init__.py +++ b/harmonypy/__init__.py @@ -1,3 +1,4 @@ from .harmony import Harmony, run_harmony from .lisi import compute_lisi -from .version import __version__ + +__version__ = '0.0.10' diff --git a/harmonypy/version.py b/harmonypy/version.py deleted file mode 100644 index 9d1ffab..0000000 --- a/harmonypy/version.py +++ /dev/null @@ -1 +0,0 @@ -__version__ = '0.0.9' diff --git a/publish_to_pypi.md b/publish_to_pypi.md deleted file mode 100644 index 0b8b237..0000000 --- a/publish_to_pypi.md +++ /dev/null @@ -1,17 +0,0 @@ -https://packaging.python.org/tutorials/packaging-projects/ - -Now run this command from the same directory where setup.py is located: - - python3 setup.py sdist bdist_wheel - -This command should output a lot of text and once completed should generate two files in the dist directory: - - dist/ - example_pkg_YOUR_USERNAME_HERE-0.0.1-py3-none-any.whl - example_pkg_YOUR_USERNAME_HERE-0.0.1.tar.gz - -python3 -m pip install --user --upgrade twine - -Run Twine to upload all of the archives under dist: - - python3 -m twine upload dist/harmonypy-0.0.4* diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bdab6c3 --- /dev/null +++ b/pyproject.toml @@ -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" +] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index e3ca03a..0000000 --- a/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -numpy>=1.13 -scipy>=1.2 -scikit-learn>=0.21 -pandas>=0.25 diff --git a/setup.py b/setup.py deleted file mode 100644 index 7ebd2da..0000000 --- a/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -import setuptools - -with open("README.md", "r") as fh: - long_description = fh.read() - -exec(open('harmonypy/version.py').read()) - -setuptools.setup( - name = "harmonypy", - version = __version__, # noqa: F821 - author = "Kamil Slowikowski", - author_email = "kslowikowski@gmail.com", - description = "A data integration algorithm.", - long_description = long_description, - long_description_content_type = "text/markdown", - url = "https://github.com/slowkow/harmonypy", - classifiers=[ - "Development Status :: 3 - Alpha", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering :: Bio-Informatics", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", - "Operating System :: OS Independent", - ], - python_requires='>=3.6', - install_requires=['pandas','numpy','scipy', 'scikit-learn'], - packages=setuptools.find_packages(), - include_package_data=True, -) diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..e69de29