Skip to content

Commit

Permalink
build: update packaging to use biocommons.example template
Browse files Browse the repository at this point in the history
* replaces setup.cfg/setup.py with pyproject.toml
* fixes make devready
* adds .flake8 + tox.ini
  • Loading branch information
korikuzma committed Feb 28, 2024
1 parent 4b7aa36 commit 34e868f
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 80 deletions.
12 changes: 12 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[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/*
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.PRECIOUS:
.SUFFIXES:

SHELL:=/bin/bash -e -o pipefail -O globstar
SHELL:=bash -e -o pipefail -O globstar
SELF:=$(firstword $(MAKEFILE_LIST))

VE_DIR=venv
Expand Down Expand Up @@ -150,13 +150,13 @@ distclean: cleanest

## <LICENSE>
## Copyright 2023 Source Code Committers
##
##
## Licensed under the Apache License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
##
## http://www.apache.org/licenses/LICENSE-2.0
##
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down
61 changes: 53 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "seqrepo-rest-service"
authors = [
{ name="biocommons contributors", email="biocommons-dev@googlegroups.com" },
{ name = "biocommons contributors", email = "biocommons-dev@googlegroups.com" },
]
description = "SeqRepo REST Service"
readme = "README.md"
Expand All @@ -16,20 +16,57 @@ classifiers = [
"Operating System :: OS Independent",
]
dynamic = ["version"]
dependencies = [
"biocommons.seqrepo ~= 0.6",
"coloredlogs",
"connexion[swagger-ui] ~= 2.2",
"Flask ~= 2.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",
"tox ~= 3.25",
"vcrpy",
]
docs = ["mkdocs"]

[project.scripts]
seqrepo-rest-service = "seqrepo_rest_service.cli:main"

[project.urls]
"Homepage" = "https://github.com/biocommons/seqrepo-rest-service"
"Bug Tracker" = "https://github.com/biocommons/seqrepo-rest-service/issues"


[build-system]
requires = [
"setuptools >= 65.3",
"setuptools_scm[toml] ~= 7.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]
"*" = ["*.gz", "*.json", "*.yaml"]


[tool.setuptools_scm]


Expand All @@ -44,8 +81,9 @@ doctest_optionflags = [
"NORMALIZE_WHITESPACE",
]
markers = [
"network: tests that require network connectivity",
"slow: slow tests that should be run infrequently",
"network: tests that require network connectivity",
"slow: slow tests that should be run infrequently",
"vcr: tests with cached data",
]


Expand Down Expand Up @@ -76,12 +114,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"

Expand Down
66 changes: 0 additions & 66 deletions setup.cfg

This file was deleted.

2 changes: 0 additions & 2 deletions setup.py

This file was deleted.

8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[tox]
envlist = py39,py310
isolated_build = True

[gh]
python =
3.9 = py39, type
3.10 = py310

0 comments on commit 34e868f

Please sign in to comment.