Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools>=61", "pbr>=2.0"]
build-backend = "setuptools.build_meta"
requires = ["hatchling", "hatch-vcs", "hatch-requirements-txt"]
build-backend = "hatchling.build"

[project]
name = "seive_cache"
dynamic = ["version"]
dynamic = ["version", "dependencies"]
description = "A simple implementation of SEIVE caching algorithm"
readme = "README.md"
requires-python = ">=3.10"
Expand All @@ -19,23 +19,21 @@ classifiers = [
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
]
dependencies = [
"stevedore>=5.1.0",
"dogpile.cache>=1.3.0",
"iso8601>=2.1.0",
]

[project.optional-dependencies]
redis = ["redis"]

[project.entry-points."dogpile.cache"]
"sieve_cache.memory" = "sieve_cache.backends.memory:InMemoryDriver"

[tool.setuptools.dynamic]
version = { attr = "sieve_cache.version.version_string" }
[tool.hatch.build.targets.wheel]
packages = ["sieve_cache"]

[tool.hatch.version]
source = "vcs"

[tool.setuptools.packages.find]
include = ["sieve_cache*"]
[tool.hatch.metadata.hooks.requirements_txt]
files = ["requirements.txt"]

[tool.ruff]
line-length = 79
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# License for the specific language governing permissions and limitations
# under the License.

pbr>=6.0.0
stevedore>=5.1.0
dogpile.cache>=1.3.0
iso8601>=2.1.0
21 changes: 0 additions & 21 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

18 changes: 16 additions & 2 deletions sieve_cache/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,21 @@
# License for the specific language governing permissions and limitations
# under the License.

import pbr.version
from importlib import metadata

version_info = pbr.version.VersionInfo("seive_cache")

class _VersionInfo:
def __init__(self, package_name):
self.package_name = package_name

def version_string(self):
for package_name in (self.package_name, "sieve_cache"):
try:
return metadata.version(package_name)
except metadata.PackageNotFoundError:
continue
return "0.0.0"


version_info = _VersionInfo("seive_cache")
version_string = version_info.version_string
19 changes: 19 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,22 @@ commands =
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report --fail-under=70 --skip-covered

[flake8]
# [H104]: Empty file with only comments
# [W504]: Line break after binary operator
# [W503]: Line break before binary operator
# [H306]: Alphabetically order your imports by the full module path
# [H405]: Multi line docstring summary not separated with an empty line
# [I202]: Additional newline in a group of imports.
ignore = H104,W504,H306,H405,W503,I202
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*lib/python*,*egg,build
import-order-style = pep8
# [H106]: Don't put vim configuration in source files
# [H203]: Use assertIs(Not)None to check for None
# [H204]: Use assert(Not)Equal to check for equality
# [H205]: Use assert(Greater|Less)(Equal) for comparison
# [H904]: Delay string interpolations at logging calls
enable-extensions = H106,H203,H204,H205,H904
Loading