Skip to content

Commit

Permalink
Fix dists (#736)
Browse files Browse the repository at this point in the history
* 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 <Adamtaranto@users.noreply.github.com>
  • Loading branch information
Adamtaranto and Adamtaranto authored Jan 4, 2025
1 parent ea05c58 commit b3438a1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 15 deletions.
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -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.

Expand All @@ -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.

Expand All @@ -164,14 +172,16 @@ 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:

```bash
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
Expand Down
18 changes: 13 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ requires = [
]
build-backend = "hatchling.build"

[tool.hatch.build.hooks.custom]
path = "build.py"

# Project metadata and configuration
[project]
Expand Down Expand Up @@ -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"
Expand All @@ -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"]
11 changes: 7 additions & 4 deletions src/jcvi/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

if __name__ == "__main__":
main()

0 comments on commit b3438a1

Please sign in to comment.