Skip to content

Commit

Permalink
publish to pypi
Browse files Browse the repository at this point in the history
  • Loading branch information
ixaxaar committed Oct 6, 2024
1 parent 3a0eb15 commit cbc2f19
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 60 deletions.
67 changes: 15 additions & 52 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
# Makefile for HOSA (Higher Order Spectral Analysis) package
.DEFAULT_GOAL := help
SHELL := /bin/bash

# Python interpreter to use
PYTHON := python3
setup: ## Install dependencies
@pip install -r ./requirements.txt

# Poetry for dependency management and packaging
POETRY := poetry
test: ## Run tests (note: requires imports)
@coverage run -m pytest -vv --log-cli-level=ERROR ./tests

.PHONY: help install dev-install clean lint test coverage build publish
publish: ## Publish to pypi
@rm -rf dist build
@python setup.py sdist bdist_wheel
@twine upload dist/* --verbose

help:
@echo "Available commands:"
@echo " install : Install the package"
@echo " dev-install : Install the package in editable mode with development dependencies"
@echo " clean : Remove build artifacts and cache files"
@echo " lint : Run linter (flake8) on the code"
@echo " test : Run tests using pytest"
@echo " coverage : Run tests and generate a coverage report"
@echo " build : Build source and wheel distributions"
@echo " publish : Publish the package to PyPI"

install:
$(POETRY) install

dev-install:
$(POETRY) install --dev

clean:
rm -rf build dist .eggs *.egg-info
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -rf {} +

lint:
$(POETRY) run flake8 hosa tests

test:
$(POETRY) run pytest

coverage:
$(POETRY) run pytest --cov=hosa --cov-report=term-missing --cov-report=xml

build:
$(POETRY) build

publish:
$(POETRY) publish

# Local development server for documentation (if using Sphinx)
docs-serve:
cd docs && $(MAKE) html && cd _build/html && $(PYTHON) -m http.server 8000

# Generate requirements.txt from poetry.lock
requirements:
$(POETRY) export -f requirements.txt --output requirements.txt --without-hashes
help: ## Dislay this help
@IFS=$$'\n'; for line in `grep -h -E '^[a-zA-Z_#-]+:?.*?## .*$$' $(MAKEFILE_LIST)`; do if [ "$${line:0:2}" = "##" ]; then \
echo $$line | awk 'BEGIN {FS = "## "}; {printf "\n\033[33m%s\033[0m\n", $$2}'; else \
echo $$line | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'; fi; \
done; unset IFS;
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Higher Order Spectral Analysis (HOSA) Toolkit
# Higher Order Spectral Analysis Toolkit

This package provides a comprehensive set of tools for higher-order spectral
analysis in Python. It includes functions for estimating bicoherence,
Expand All @@ -9,7 +9,7 @@ bispectrum, and various orders of cumulants.
You can install the HOSA toolkit using pip:

```bash
pip install spectrum
pip install higher-spectrum
```

## Contents
Expand Down
7 changes: 3 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
numpy
scipy
matplotlib
torch
matplotlib>=3.7.0
scipy>=1.12.1
numpy>=1.22.1
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
long_description = f.read()

setup(
name="spectrum",
version="1.0.0",
name="higher-spectrum",
version="0.2.0",
packages=find_packages(),
install_requires=["numpy>=1.18.0", "scipy>=1.4.0", "matplotlib>=3.1.0"],
include_package_data=True,
Expand Down

0 comments on commit cbc2f19

Please sign in to comment.