-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add pip package called sdcat with poetry build and other minor co…
…rrections in comments
- Loading branch information
1 parent
782848d
commit dbe494a
Showing
9 changed files
with
162 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Development | ||
|
||
## Development Environment | ||
|
||
For development, an Anaconda environment is recommended. This will create a conda environment | ||
called `sdcat`. | ||
|
||
```shell | ||
conda env create | ||
conda activate sdcat | ||
``` | ||
|
||
Alternatively, you can use `poetry` to manage the environment. This will create a virtual environment | ||
called `sdcat`. | ||
|
||
```shell | ||
poetry install | ||
poetry shell | ||
``` | ||
|
||
|
||
## Running the tests | ||
|
||
Run tests before checking code back in. To run tests, first install pytest: | ||
|
||
```shell | ||
pip install pytest | ||
pytest | ||
``` | ||
|
||
The tests should run and pass. | ||
|
||
```shell | ||
pytest | ||
``` | ||
|
||
```shell | ||
=========================================================================================================================================================================================================================== test session starts ============================================================================================================================================================================================================================ | ||
platform darwin -- Python 3.10.13, pytest-7.4.4, pluggy-1.3.0 | ||
rootdir: /Users/dcline/Dropbox/code/sdcat | ||
plugins: napari-plugin-engine-0.2.0, anyio-3.7.1, napari-0.4.18, npe2-0.7.3 | ||
collected 3 items | ||
|
||
tests/test_detect.py ... [100%] | ||
|
||
======================================================================================================================================================================================================================= 3 passed in 61.48s (0:01:01) ======================================================================================================================================================================================================================== | ||
``` | ||
In poetry, you can run the tests with: | ||
|
||
```shell | ||
poetry run pytest | ||
``` | ||
|
||
# Building python package | ||
|
||
To build the python package, run the following command: | ||
|
||
```shell | ||
poetry build | ||
``` | ||
|
||
This will create a `dist` directory with the package in it. | ||
|
||
Test the package by installing it in a new environment, e.g.: | ||
|
||
```shell | ||
pip install dist/mbari-sdcat-0.1.0.tar.gz | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,4 +24,60 @@ exclude_commit_patterns = [ | |
'''Initial Commit.*''', | ||
# Old semantic-release version commits | ||
'''^\d+\.\d+\.\d+''', | ||
] | ||
] | ||
|
||
[tool.poetry] | ||
name = "sdcat" | ||
version = "1.7.0" | ||
description = "Sliced Detection and Clustering Analysis Toolkit - Developed by MBARI" | ||
authors = ["danellecline <[email protected]>"] | ||
license = "Apache" | ||
readme = "README.md" | ||
packages = [ | ||
{ include = "sdcat" } | ||
] | ||
|
||
[tool.poetry.scripts] | ||
sdcat = "sdcat.__main__:cli" | ||
|
||
[tool.poetry.dependencies] | ||
python = ">=3.9,<3.12" | ||
pillow = "^10.4.0" | ||
bs4 = "^0.0.2" | ||
opencv-contrib-python-headless = "^4.10.0.84" | ||
sahi = "^0.11.18" | ||
mmdet = "2.21.0" | ||
mmengine = "0.7.2" | ||
click = "^8.1.7" | ||
hdbscan = ">=0.8.27" | ||
torch = "2.3.1" | ||
piexif = "^1.1.3" | ||
yolov5 = "7.0.13" | ||
torchvision = "0.18.1" | ||
transformers = "^4.42.4" | ||
timm = "^1.0.7" | ||
pandas = ">=1.2.4" | ||
ultralytics = "^8.2.57" | ||
scikit-learn = "1.4.0rc1" | ||
scikit-image = "^0.24.0" | ||
umap-learn = "0.5.5" | ||
matplotlib = "3.7.0" | ||
numba = "0.57" | ||
ephem = "^4.1.5" | ||
tqdm = "^4.66.4" | ||
|
||
[tool.poetry.group.dev.dependencies] | ||
build = "^1.2.1" | ||
twine = "^5.1.1" | ||
|
||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.mypy] | ||
show_error_codes = true | ||
ignore_missing_imports = true | ||
|
||
[tool.pytest.ini_options] | ||
testpaths = ["sdcat/tests",] | ||
pythonpath = ["."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ mmengine==0.7.2 | |
click | ||
hdbscan==0.8.33 | ||
torch==2.3.1 | ||
tator | ||
piexif | ||
yolov5==7.0.13 | ||
torchvision==0.18.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters