diff --git a/Makefile b/Makefile index e7c660c..0e53256 100644 --- a/Makefile +++ b/Makefile @@ -5,7 +5,9 @@ .PRECIOUS: .SUFFIXES: -SHELL:=/bin/bash -e -o pipefail -O globstar + +SHELL:=bash -e -o pipefail -O globstar + SELF:=$(firstword $(MAKEFILE_LIST)) VE_DIR=venv diff --git a/README.md b/README.md index 8a4eb00..f868a65 100644 --- a/README.md +++ b/README.md @@ -105,10 +105,18 @@ answer](https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-inv ## Quick Start -On Ubuntu 16.04: +### OSX + + $ brew install python libpq + +### On Ubuntu 16.04 $ sudo apt install -y python3-dev gcc zlib1g-dev tabix - (OSX: $ brew install python libpq) + +### All platforms + + $ python -m venv venv + $ source venv/bin/activate $ pip install seqrepo $ sudo mkdir -p /usr/local/share/seqrepo $ sudo chown $USER /usr/local/share/seqrepo @@ -157,6 +165,14 @@ a moderate value (>10) will greatly increase performance of sequence retrieval. ## Developing +### OSX + + brew install python libpq bash + +### Ubuntu + + sudo apt install -y python3-dev gcc zlib1g-dev tabix + Here's how to get started developing: make devready diff --git a/pyproject.toml b/pyproject.toml index 91db04f..cf59969 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,11 @@ [project] name = "biocommons.seqrepo" authors = [ - { name="biocommons contributors", email="biocommons-dev@googlegroups.com" }, + { name = "biocommons contributors", email = "biocommons-dev@googlegroups.com" }, ] description = "Non-redundant, compressed, journalled, file-based storage for biological sequences" readme = "README.md" -license = { file="LICENSE.txt" } +license = { file = "LICENSE.txt" } requires-python = ">=3.9" classifiers = [ "Programming Language :: Python :: 3", @@ -15,31 +15,64 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ] -dynamic = ["version", "optional-dependencies"] +dynamic = ["version"] dependencies = [ "bioutils > 0.4", - "coloredlogs", - "ipython", - "pysam", - "requests", - "requests_html", - "six", - "tqdm", - "yoyo-migrations" + "coloredlogs ~= 15.0", + "ipython ~= 8.4", + "pysam ~= 0.22", + "requests ~= 2.31", + "six ~= 1.16", + "yoyo-migrations ~= 8.2", ] +[project.optional-dependencies] +dev = [ + "bandit ~= 1.7", + "black ~= 22.3", + "build ~= 0.8", + "flake8 ~= 4.0", + "ipython ~= 8.4", + "isort ~= 5.10", + "mypy-extensions ~= 1.0", + "pre-commit ~= 3.4", + "pylint ~= 2.14", + "pytest-cov ~= 4.1", + "pytest-optional-tests", + "pytest ~= 7.1", + "pyright~=1.1", + "requests_html ~= 0.10", + "tqdm ~= 4.66", + "tox ~= 3.25", + "vcrpy", +] +docs = ["mkdocs"] + +[project.scripts] +seqrepo = "biocommons.seqrepo.cli:main" + [project.urls] "Homepage" = "https://github.com/biocommons/biocommons.seqrepo" "Bug Tracker" = "https://github.com/biocommons/biocommons.seqrepo/issues" [build-system] -requires = [ - "setuptools >= 69.0.2", - "setuptools_scm[toml] >= 8.0" -] +requires = ["setuptools ~= 69.0", "setuptools_scm[toml] ~= 8.0"] build-backend = "setuptools.build_meta" +[tool.setuptools] +include-package-data = true + +[tool.setuptools.packages.find] +where = ["src"] +exclude = ["__pycache__", "*.pyc"] +namespaces = true + +[tool.setuptools.package-data] +"biocommons.seqrepo.fastadir" = ["_data/migrations/*"] +"biocommons.seqrepo.seqaliasdb" = ["_data/migrations/*"] + + [tool.setuptools_scm] @@ -54,9 +87,9 @@ doctest_optionflags = [ "NORMALIZE_WHITESPACE", ] markers = [ - "network: tests that require network connectivity", - "slow: slow tests that should be run infrequently", - "vcr: tests with cached data", + "network: tests that require network connectivity", + "slow: slow tests that should be run infrequently", + "vcr: tests with cached data", ] @@ -87,12 +120,19 @@ exclude_lines = [ [tool.black] line-length = 100 +[tool.isort] +profile = "black" +src_paths = ["src", "tests"] # [tool.flake8] # flake8 does not support configuration in pyproject.toml # https://github.com/PyCQA/flake8/issues/234#issuecomment-812800832 # The config in setup.cfg +[tool.pyright] +include = ["src", "tests"] + + [tool.pylint.'MESSAGES CONTROL'] disable = "R0913" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index d0fb3f5..0000000 --- a/setup.cfg +++ /dev/null @@ -1,56 +0,0 @@ -[metadata] -name = biocommons.seqrepo - -[options] -include_package_data = True -packages = find_namespace: -package_dir = - = src -zip_safe = True - -[options.extras_require] -dev = - bandit - black - cython - flake8 - isort - pytest - pytest-cov - pytest-runner - setuptools_scm - vcrpy - wheel -docs = - mkdocs - -[options.entry_points] -console_scripts = - seqrepo = biocommons.seqrepo.cli:main - -[options.packages.find] -where = src -exclude = - __pycache__ - *.pyc - -[options.package_data] -biocommons.seqrepo.fastadir = - _data/migrations/* -biocommons.seqrepo.seqaliasdb = - _data/migrations/* - - -[flake8] -ignore = E129,E133,E203,E221,E241,E251,E303,E266,H106,H904,W291 -max-line-length = 100 -max-complexity = 15 -hang-closing = true -exclude = - .eggs - .tox - build - dist - docs/conf.py - tests/* -