From b3438a188280d3eb64722bba4bfa0fa0ac444f81 Mon Sep 17 00:00:00 2001 From: Adam Taranto Date: Sun, 5 Jan 2025 02:35:39 +1100 Subject: [PATCH] Fix dists (#736) * Add libmagick of linux note * include cython modules in wheel * Style fixes by Black * include src dir in dist tarball * format headings --------- Co-authored-by: Adamtaranto --- README.md | 22 ++++++++++++++++------ pyproject.toml | 18 +++++++++++++----- src/jcvi/cli.py | 11 +++++++---- 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index e6767f86..98b8ca61 100644 --- a/README.md +++ b/README.md @@ -106,6 +106,15 @@ full-fledged applications. JCVI requires Python3 between v3.8 and v3.12. +Some graphics modules require the [ImageMagick](https://imagemagick.org/index.php) library. + +On MacOS this can be installed using Conda (see next section). If you are using a linux system (i.e. Ubuntu) you can install ImageMagick using apt-get: + +```bash +sudo apt-get update +sudo apt-get install libmagickwand-dev +``` + A few modules may ask for locations of external programs, if the executable cannot be found in your `PATH`. @@ -115,11 +124,9 @@ The external programs that are often used are: - [BEDTOOLS](http://code.google.com/p/bedtools/) - [EMBOSS](http://emboss.sourceforge.net/) -## Installation - -**Installing JCVI in a Conda environment:** +### Managing dependencies with Conda -You can create a Conda environment with Python 3.12 and basic dependencies for JCVI using the YAML files in this repo. +You can use the the YAML files in this repo to create an environment with basic JCVI dependencies. If you are new to Conda, we recommend the [Miniforge](https://conda-forge.org/download/) distribution. @@ -142,8 +149,9 @@ conda activate jcvi-osx64 After activating the Conda environment install JCVI using one of the following options. +## Installation -**Installation options:** +### Installation options 1) Use pip to install the latest development version directly from this repo. @@ -164,7 +172,7 @@ git clone git://github.com/tanghaibao/jcvi.git && cd jcvi pip install -e '.[tests]' ``` -**Test Installation:** +### Test Installation If installed successfully, you can check the version with: @@ -172,6 +180,8 @@ If installed successfully, you can check the version with: jcvi --version ``` +## Usage + Use `python -m` to call any of the modules installed with JCVI. Most of the modules in this package contains multiple actions. To use diff --git a/pyproject.toml b/pyproject.toml index a87b262b..aaec128c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,8 +9,6 @@ requires = [ ] build-backend = "hatchling.build" -[tool.hatch.build.hooks.custom] -path = "build.py" # Project metadata and configuration [project] @@ -87,14 +85,22 @@ jcvi = "jcvi.cli:main" allow-direct-references = true [tool.hatch.build] -packages = ["src/jcvi"] +packages = ["src"] +artifacts = [ + "src/jcvi/**/*.so", # Linux/Mac shared objects + "src/jcvi/**/*.pyd", # Windows shared objects + "src/jcvi/**/*.c" # Generated C files +] -[tool.hatch.version] -source = "vcs" +[tool.hatch.build.hooks.custom] +path = "build.py" [tool.hatch.build.hooks.vcs] version-file = "src/jcvi/_version.py" +[tool.hatch.version] +source = "vcs" + [tool.hatch.version.vcs] tag-pattern = "v*" fallback-version = "0.0.0" @@ -106,5 +112,7 @@ include = [ "README.md", ] +force-include = { "build.py" = "build.py", "setup.py" = "setup.py"} + [tool.hatch.build.targets.wheel] packages = ["src/jcvi"] \ No newline at end of file diff --git a/src/jcvi/cli.py b/src/jcvi/cli.py index b55e091a..6af68823 100644 --- a/src/jcvi/cli.py +++ b/src/jcvi/cli.py @@ -2,11 +2,14 @@ import argparse from . import __version__ + def main(): parser = argparse.ArgumentParser() - parser.add_argument('--version', action='version', - version=f'%(prog)s {__version__}') + parser.add_argument( + "--version", action="version", version=f"%(prog)s {__version__}" + ) args = parser.parse_args() -if __name__ == '__main__': - main() \ No newline at end of file + +if __name__ == "__main__": + main()