navigator-session 0.6.2__tar.gz → 0.8.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. navigator_session-0.8.0/Makefile +85 -0
  2. {navigator_session-0.6.2 → navigator_session-0.8.0}/PKG-INFO +9 -10
  3. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/data.py +37 -22
  4. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/storages/redis.py +1 -1
  5. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/version.py +6 -4
  6. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session.egg-info/PKG-INFO +9 -10
  7. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session.egg-info/requires.txt +1 -1
  8. navigator_session-0.8.0/pyproject.toml +98 -0
  9. navigator_session-0.8.0/setup.py +7 -0
  10. navigator_session-0.6.2/Makefile +0 -33
  11. navigator_session-0.6.2/pyproject.toml +0 -67
  12. navigator_session-0.6.2/setup.py +0 -101
  13. {navigator_session-0.6.2 → navigator_session-0.8.0}/CHANGES.rst +0 -0
  14. {navigator_session-0.6.2 → navigator_session-0.8.0}/LICENSE +0 -0
  15. {navigator_session-0.6.2 → navigator_session-0.8.0}/MANIFEST.in +0 -0
  16. {navigator_session-0.6.2 → navigator_session-0.8.0}/README.md +0 -0
  17. {navigator_session-0.6.2 → navigator_session-0.8.0}/docs/Makefile +0 -0
  18. {navigator_session-0.6.2 → navigator_session-0.8.0}/docs/api.rst +0 -0
  19. {navigator_session-0.6.2 → navigator_session-0.8.0}/docs/authors.rst +0 -0
  20. {navigator_session-0.6.2 → navigator_session-0.8.0}/docs/conf.py +0 -0
  21. {navigator_session-0.6.2 → navigator_session-0.8.0}/docs/examples.rst +0 -0
  22. {navigator_session-0.6.2 → navigator_session-0.8.0}/docs/index.rst +0 -0
  23. {navigator_session-0.6.2 → navigator_session-0.8.0}/docs/make.bat +0 -0
  24. {navigator_session-0.6.2 → navigator_session-0.8.0}/docs/requirements-dev.txt +0 -0
  25. {navigator_session-0.6.2 → navigator_session-0.8.0}/docs/requirements.txt +0 -0
  26. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/__init__.py +0 -0
  27. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/conf.py +0 -0
  28. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/middleware.py +0 -0
  29. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/session.py +0 -0
  30. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/storages/__init__.py +0 -0
  31. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/storages/abstract.py +0 -0
  32. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session/storages/cookie.py +0 -0
  33. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session.egg-info/SOURCES.txt +0 -0
  34. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session.egg-info/dependency_links.txt +0 -0
  35. {navigator_session-0.6.2 → navigator_session-0.8.0}/navigator_session.egg-info/top_level.txt +0 -0
  36. {navigator_session-0.6.2 → navigator_session-0.8.0}/setup.cfg +0 -0
  37. {navigator_session-0.6.2 → navigator_session-0.8.0}/tests/__init__.py +0 -0
@@ -0,0 +1,85 @@
1
+ # Navigator-Session Makefile
2
+
3
+ .PHONY: venv install develop release format lint test clean distclean lock sync
4
+
5
+ # Python version to use
6
+ PYTHON_VERSION := 3.11
7
+
8
+ # Auto-detect available tools
9
+ HAS_UV := $(shell command -v uv 2> /dev/null)
10
+
11
+ # Install uv if missing
12
+ install-uv:
13
+ curl -LsSf https://astral.sh/uv/install.sh | sh
14
+ @echo "uv installed! You may need to restart your shell or run 'source ~/.bashrc'"
15
+
16
+ # Create virtual environment
17
+ venv:
18
+ uv venv --python $(PYTHON_VERSION) .venv
19
+ @echo 'run `source .venv/bin/activate` to start develop Navigator-Session'
20
+
21
+ # Install production dependencies using lock file
22
+ install:
23
+ uv sync --frozen --no-dev
24
+ @echo "Production dependencies installed."
25
+
26
+ # Generate lock files
27
+ lock:
28
+ ifdef HAS_UV
29
+ uv lock
30
+ else
31
+ @echo "Lock files require uv. Install with: make install-uv"
32
+ endif
33
+
34
+ # Install all dependencies including dev dependencies
35
+ develop:
36
+ uv sync --frozen --dev
37
+
38
+ # Alternative: install without lock file (faster for development)
39
+ develop-fast:
40
+ uv pip install -e .
41
+ uv pip install -e .[dev]
42
+
43
+ # Build and publish release
44
+ release: lint test clean
45
+ uv build
46
+ uv publish
47
+
48
+ # Format code
49
+ format:
50
+ uv run black navigator_session
51
+
52
+ # Lint code
53
+ lint:
54
+ uv run pylint --rcfile .pylintrc navigator_session/*.py
55
+ uv run black --check navigator_session
56
+
57
+ # Run tests
58
+ test:
59
+ uv run coverage run -m pytest tests
60
+ uv run coverage report
61
+ uv run mypy navigator_session/*.py
62
+
63
+ # Performance tests
64
+ perf:
65
+ uv run python -m unittest -v navigator_session.tests.perf
66
+
67
+ # Clean build artifacts
68
+ clean:
69
+ rm -rf build/
70
+ rm -rf dist/
71
+ rm -rf *.egg-info/
72
+ find . -name "*.pyc" -delete
73
+ find . -name "*.pyo" -delete
74
+ find . -name "*.so" -delete
75
+ find . -type d -name __pycache__ -delete
76
+ @echo "Clean complete."
77
+
78
+ # Remove virtual environment
79
+ distclean:
80
+ rm -rf .venv
81
+ rm -rf uv.lock
82
+
83
+ # Show project info
84
+ info:
85
+ uv tree
@@ -1,18 +1,16 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: navigator-session
3
- Version: 0.6.2
3
+ Version: 0.8.0
4
4
  Summary: Navigator Session allows us to store user-specific data into session object.
5
- Home-page: https://github.com/phenobarbital/navigator-session
6
- Author: Jesus Lara
7
- Author-email: jesuslarag@gmail.com
8
- License: Apache-2.0
5
+ Author-email: Jesus Lara Gimenez <jesuslarag@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/phenobarbital/navigator-session
9
8
  Project-URL: Source, https://github.com/phenobarbital/navigator-session
10
9
  Project-URL: Funding, https://paypal.me/phenobarbital
11
- Project-URL: Say Thanks!, https://saythanks.io/to/phenobarbital
12
- Keywords: asyncio,session,aioredis,aiohttp
13
- Platform: POSIX
10
+ Project-URL: Documentation, https://github.com/phenobarbital/navigator-session
14
11
  Classifier: Development Status :: 4 - Beta
15
12
  Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: System Administrators
16
14
  Classifier: Operating System :: POSIX :: Linux
17
15
  Classifier: Environment :: Web Environment
18
16
  Classifier: Topic :: Software Development :: Build Tools
@@ -31,8 +29,9 @@ Requires-Dist: aiohttp>=3.9.5
31
29
  Requires-Dist: asyncio==3.4.3
32
30
  Requires-Dist: jsonpickle>=3.0.2
33
31
  Requires-Dist: redis>=5.0.4
34
- Requires-Dist: python_datamodel>=0.7.0
32
+ Requires-Dist: python-datamodel>=0.7.0
35
33
  Requires-Dist: navconfig[default]>=1.7.0
34
+ Dynamic: license-file
36
35
 
37
36
  # Navigator_Session #
38
37
 
@@ -1,9 +1,8 @@
1
1
  import uuid
2
2
  import time
3
3
  from typing import Union, Optional, Any
4
- from datetime import datetime
4
+ from datetime import datetime, timezone
5
5
  from collections.abc import Iterator, Mapping, MutableMapping
6
- import pendulum
7
6
  import jsonpickle
8
7
  from jsonpickle.unpickler import loadclass
9
8
  from aiohttp import web
@@ -13,6 +12,11 @@ from .conf import (
13
12
  SESSION_ID,
14
13
  SESSION_STORAGE
15
14
  )
15
+ try:
16
+ from pydantic import BaseModel as PydanticBaseModel
17
+ except ImportError:
18
+ PydanticBaseModel = None
19
+
16
20
 
17
21
  class ModelHandler(jsonpickle.handlers.BaseHandler):
18
22
  """ModelHandler.
@@ -25,16 +29,31 @@ class ModelHandler(jsonpickle.handlers.BaseHandler):
25
29
  def restore(self, obj):
26
30
  module_and_type = obj['py/object']
27
31
  mdl = loadclass(module_and_type)
28
- if hasattr(mdl, '__new__'):
29
- cls = mdl.__new__(mdl)
30
- else:
31
- cls = object.__new__(mdl)
32
-
32
+ cls = mdl.__new__(mdl) if hasattr(mdl, '__new__') else object.__new__(mdl)
33
33
  cls.__dict__ = self.context.restore(obj['__dict__'], reset=False)
34
34
  return cls
35
35
 
36
36
  jsonpickle.handlers.registry.register(BaseModel, ModelHandler, base=True)
37
37
 
38
+ if PydanticBaseModel:
39
+ class PydanticHandler(jsonpickle.handlers.BaseHandler):
40
+ """PydanticHandler.
41
+ This class can handle with serializable Pydantic Models.
42
+ """
43
+ def flatten(self, obj, data):
44
+ data['__dict__'] = self.context.flatten(obj.__dict__, reset=False)
45
+ return data
46
+
47
+ def restore(self, obj):
48
+ module_and_type = obj['py/object']
49
+ mdl = loadclass(module_and_type)
50
+ cls = mdl.__new__(mdl) if hasattr(mdl, '__new__') else object.__new__(mdl)
51
+ cls.__dict__ = self.context.restore(obj['__dict__'], reset=False)
52
+ return cls
53
+
54
+ jsonpickle.handlers.registry.register(PydanticBaseModel, PydanticHandler, base=True)
55
+
56
+
38
57
  class SessionData(MutableMapping[str, Any]):
39
58
  """Session dict-like object.
40
59
  """
@@ -53,33 +72,29 @@ class SessionData(MutableMapping[str, Any]):
53
72
  self._changed = False
54
73
  self._data = {}
55
74
  # Unique ID:
56
- self._id_ = data.get(SESSION_ID, None) if data else id
57
- if not self._id_:
58
- self._id_ = uuid.uuid4().hex
75
+ self._id_ = (data.get(SESSION_ID, None) if data else id) or uuid.uuid4().hex
59
76
  # Session Identity
60
- self._identity = data.get(SESSION_KEY, None) if data else identity
61
- if not self._identity:
62
- self._identity = self._id_
77
+ self._identity = (
78
+ data.get(SESSION_KEY, None) if data else identity
79
+ ) or self._id_
63
80
  self._new = new if data != {} else True
64
- self._max_age = max_age if max_age else None
81
+ self._max_age = max_age or None
65
82
  created = data.get('created', None) if data else None
66
- self._now = pendulum.now('UTC') # time for this instance creation
83
+ self._now = datetime.now(timezone.utc)
67
84
  self.__created__ = self._now
68
- now = int(self._now.int_timestamp)
85
+ now = int(self._now.timestamp())
69
86
  self._now = now # time for this instance creation
70
87
  age = now - created if created else now
71
88
  if max_age is not None and age > max_age:
72
89
  data = None
73
- if self._new or created is None:
74
- self._created = now
75
- else:
76
- self._created = created
90
+ self._created = now if self._new or created is None else created
77
91
  ## Data updating.
78
92
  if data is not None:
79
93
  self._data.update(data)
80
94
  # Other mark timestamp for this session:
81
- dt = pendulum.now('UTC')
82
- self._dow = dt.day_of_week
95
+ dt = datetime.now(timezone.utc)
96
+ self._dow = dt.weekday()
97
+ self._doy = dt.timetuple().tm_yday
83
98
  self._time = dt.time()
84
99
  self.args = args
85
100
 
@@ -249,7 +249,7 @@ class RedisStorage(AbstractStorage):
249
249
  ) -> SessionData:
250
250
  """Create a New Session Object for this User."""
251
251
  session_identity = request.get(SESSION_KEY, None)
252
- session_id = request.get(SESSION_ID, None)
252
+ session_id = data.get(SESSION_ID, request.get(SESSION_ID, None))
253
253
  try:
254
254
  conn = aioredis.Redis(connection_pool=self._redis)
255
255
  except Exception as err:
@@ -1,11 +1,13 @@
1
1
  """Navigator Session Meta information.
2
2
  Navigator Session allows us to store user-specific data into session object.
3
3
  """
4
-
5
4
  __title__ = 'navigator_session'
6
- __description__ = ('Navigator Session allows us to store user-specific data '
7
- 'into session object.')
8
- __version__ = '0.6.2'
5
+ __description__ = (
6
+ 'Navigator Session allows us to store user-specific data '
7
+ 'into session object.'
8
+ )
9
+ __version__ = '0.8.0'
10
+ __copyright__ = 'Copyright (c) 2023 Jesus Lara'
9
11
  __author__ = 'Jesus Lara'
10
12
  __author_email__ = 'jesuslarag@gmail.com'
11
13
  __license__ = 'Apache-2.0'
@@ -1,18 +1,16 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: navigator-session
3
- Version: 0.6.2
3
+ Version: 0.8.0
4
4
  Summary: Navigator Session allows us to store user-specific data into session object.
5
- Home-page: https://github.com/phenobarbital/navigator-session
6
- Author: Jesus Lara
7
- Author-email: jesuslarag@gmail.com
8
- License: Apache-2.0
5
+ Author-email: Jesus Lara Gimenez <jesuslarag@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/phenobarbital/navigator-session
9
8
  Project-URL: Source, https://github.com/phenobarbital/navigator-session
10
9
  Project-URL: Funding, https://paypal.me/phenobarbital
11
- Project-URL: Say Thanks!, https://saythanks.io/to/phenobarbital
12
- Keywords: asyncio,session,aioredis,aiohttp
13
- Platform: POSIX
10
+ Project-URL: Documentation, https://github.com/phenobarbital/navigator-session
14
11
  Classifier: Development Status :: 4 - Beta
15
12
  Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: System Administrators
16
14
  Classifier: Operating System :: POSIX :: Linux
17
15
  Classifier: Environment :: Web Environment
18
16
  Classifier: Topic :: Software Development :: Build Tools
@@ -31,8 +29,9 @@ Requires-Dist: aiohttp>=3.9.5
31
29
  Requires-Dist: asyncio==3.4.3
32
30
  Requires-Dist: jsonpickle>=3.0.2
33
31
  Requires-Dist: redis>=5.0.4
34
- Requires-Dist: python_datamodel>=0.7.0
32
+ Requires-Dist: python-datamodel>=0.7.0
35
33
  Requires-Dist: navconfig[default]>=1.7.0
34
+ Dynamic: license-file
36
35
 
37
36
  # Navigator_Session #
38
37
 
@@ -2,5 +2,5 @@ aiohttp>=3.9.5
2
2
  asyncio==3.4.3
3
3
  jsonpickle>=3.0.2
4
4
  redis>=5.0.4
5
- python_datamodel>=0.7.0
5
+ python-datamodel>=0.7.0
6
6
  navconfig[default]>=1.7.0
@@ -0,0 +1,98 @@
1
+ requires = [
2
+ 'setuptools>=74.0.0',
3
+ 'Cython>=3.0.11',
4
+ 'wheel>=0.44.0'
5
+ ]
6
+ build-backend = "setuptools.build_meta"
7
+
8
+ [project]
9
+ name = "navigator-session"
10
+ dynamic = ["version"]
11
+ description = "Navigator Session allows us to store user-specific data into session object."
12
+ readme = "README.md"
13
+ requires-python = ">=3.9.13"
14
+ license = "Apache-2.0"
15
+ authors = [
16
+ { name = "Jesus Lara Gimenez", email = "jesuslarag@gmail.com" }
17
+ ]
18
+ classifiers = [
19
+ "Development Status :: 4 - Beta",
20
+ "Intended Audience :: Developers",
21
+ "Intended Audience :: System Administrators",
22
+ "Operating System :: POSIX :: Linux",
23
+ "Environment :: Web Environment",
24
+ "Topic :: Software Development :: Build Tools",
25
+ "Topic :: Software Development :: Libraries :: Python Modules",
26
+ "Topic :: Database :: Front-Ends",
27
+ "Programming Language :: Python :: 3.9",
28
+ "Programming Language :: Python :: 3.10",
29
+ "Programming Language :: Python :: 3.11",
30
+ "Programming Language :: Python :: 3.12",
31
+ "Framework :: AsyncIO",
32
+ "Framework :: aiohttp",
33
+ ]
34
+ dependencies = [
35
+ "aiohttp>=3.9.5",
36
+ "asyncio==3.4.3",
37
+ "jsonpickle>=3.0.2",
38
+ "redis>=5.0.4",
39
+ "python-datamodel>=0.7.0",
40
+ "navconfig[default]>=1.7.0",
41
+ ]
42
+
43
+ [dependency-groups]
44
+ dev = [
45
+ "pytest",
46
+ "pytest-asyncio",
47
+ "pytest-cov",
48
+ "coverage",
49
+ "mypy",
50
+ "pylint",
51
+ "black",
52
+ "flake8"
53
+ ]
54
+
55
+ [project.urls]
56
+ Homepage = "https://github.com/phenobarbital/navigator-session"
57
+ Source = "https://github.com/phenobarbital/navigator-session"
58
+ Funding = "https://paypal.me/phenobarbital"
59
+ Documentation = "https://github.com/phenobarbital/navigator-session"
60
+
61
+ [tool.setuptools.packages.find]
62
+ where = ["."]
63
+ include = ["navigator_session*"]
64
+ exclude = ["tests*", "docs*", "examples*"]
65
+
66
+ [tool.setuptools.dynamic]
67
+ version = {attr = "navigator_session.version.__version__"}
68
+
69
+ [tool.pytest.ini_options]
70
+ addopts = [
71
+ "--strict-config",
72
+ "--strict-markers",
73
+ ]
74
+ log_cli = true
75
+ log_cli_level = "DEBUG"
76
+ log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
77
+ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
78
+ filterwarnings = [
79
+ "error",
80
+ 'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio',
81
+ ]
82
+
83
+ [tool.black]
84
+ line-length = 88
85
+ include = '\.pyi?$'
86
+ exclude = '''
87
+ /(
88
+ \.git
89
+ | \.hg
90
+ | \.mypy_cache
91
+ | \.tox
92
+ | \.venv
93
+ | _build
94
+ | buck-out
95
+ | build
96
+ | dist
97
+ )/
98
+ '''
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env python
2
+ """Minimal setup.py shim."""
3
+
4
+ from setuptools import setup
5
+
6
+ if __name__ == "__main__":
7
+ setup()
@@ -1,33 +0,0 @@
1
- venv:
2
- python3.11 -m venv .venv
3
- echo 'run `source .venv/bin/activate` to start develop Navigator-Session'
4
-
5
- install:
6
- pip install -e .
7
-
8
- develop:
9
- pip install -e .
10
- pip install -Ur docs/requirements-dev.txt
11
- flit install --symlink
12
-
13
- release:
14
- lint test clean
15
- flit publish
16
-
17
- format:
18
- python -m black navigator_session
19
-
20
- lint:
21
- python -m pylint --rcfile .pylintrc navigator_session/*.py
22
- python -m black --check navigator_session
23
-
24
- test:
25
- python -m coverage run -m navigator_session.tests
26
- python -m coverage report
27
- python -m mypy navigator_session/*.py
28
-
29
- perf:
30
- python -m unittest -v navigator_session.tests.perf
31
-
32
- distclean:
33
- rm -rf .venv
@@ -1,67 +0,0 @@
1
- [build-system]
2
- requires = [
3
- 'setuptools==74.0.0',
4
- 'Cython==3.0.11',
5
- 'wheel==0.44.0'
6
- ]
7
-
8
- build-backend = "setuptools.build_meta"
9
-
10
- [tool.flit.metadata]
11
- module = "navigator_session"
12
- author = "Jesus Lara Gimenez"
13
- author-email = "jesuslarag@gmail.com"
14
- home-page = "https://github.com/phenobarbital/navigator-session"
15
- classifiers=[
16
- "Development Status :: 4 - Beta",
17
- "Intended Audience :: Developers",
18
- "Intended Audience :: System Administrators",
19
- "Operating System :: OS Independent",
20
- "Programming Language :: Python :: 3.9",
21
- "Programming Language :: Python :: 3.10",
22
- "Programming Language :: Python :: 3.11",
23
- "Programming Language :: Python :: 3.12",
24
- "Programming Language :: Python",
25
- "Typing :: Typed",
26
- "Environment :: Web Environment",
27
- "Framework :: AsyncIO",
28
- "Topic :: Software Development :: Libraries :: Application Frameworks",
29
- "Topic :: Software Development :: Libraries :: Python Modules",
30
- "Topic :: Software Development :: Build Tools",
31
- "Topic :: Internet :: WWW/HTTP :: HTTP Servers",
32
- "Topic :: Internet :: WWW/HTTP",
33
- "License :: OSI Approved :: BSD License",
34
- ]
35
- description-file = "README.md"
36
- requires-python = ">=3.9.13"
37
-
38
- [tool.pytest.ini_options]
39
- addopts = [
40
- "--strict-config",
41
- "--strict-markers",
42
- ]
43
- log_cli = true
44
- log_cli_level = "DEBUG"
45
- log_cli_format = "%(asctime)s [%(levelname)8s] %(message)s (%(filename)s:%(lineno)s)"
46
- log_cli_date_format = "%Y-%m-%d %H:%M:%S"
47
- filterwarnings = [
48
- "error",
49
- 'ignore:The loop argument is deprecated since Python 3\.8, and scheduled for removal in Python 3\.10:DeprecationWarning:asyncio',
50
- ]
51
-
52
- [tool.black]
53
- line-length = 88
54
- include = '\.pyi?$'
55
- exclude = '''
56
- /(
57
- \.git
58
- | \.hg
59
- | \.mypy_cache
60
- | \.tox
61
- | \.venv
62
- | _build
63
- | buck-out
64
- | build
65
- | dist
66
- )/
67
- '''
@@ -1,101 +0,0 @@
1
- #!/usr/bin/env python
2
- """Navigator-Session.
3
-
4
- Asynchronous library for managing user-specific data into a session object,
5
- used by Navigator.
6
- See:
7
- https://github.com/phenobarbital/navigator-session
8
- """
9
- import ast
10
- from os import path
11
- from setuptools import find_packages, setup
12
-
13
-
14
- def get_path(filename):
15
- return path.join(path.dirname(path.abspath(__file__)), filename)
16
-
17
-
18
- def readme():
19
- with open(get_path('README.md'), 'r', encoding='utf-8') as rd:
20
- return rd.read()
21
-
22
-
23
- version = get_path('navigator_session/version.py')
24
- with open(version, 'r', encoding='utf-8') as meta:
25
- # exec(meta.read())
26
- t = compile(meta.read(), version, 'exec', ast.PyCF_ONLY_AST)
27
- for node in (n for n in t.body if isinstance(n, ast.Assign)):
28
- if len(node.targets) == 1:
29
- name = node.targets[0]
30
- if isinstance(name, ast.Name) and \
31
- name.id in (
32
- '__version__',
33
- '__title__',
34
- '__description__',
35
- '__author__',
36
- '__license__',
37
- '__author_email__'
38
- ):
39
- v = node.value
40
- if name.id == '__version__':
41
- __version__ = v.s
42
- if name.id == '__title__':
43
- __title__ = v.s
44
- if name.id == '__description__':
45
- __description__ = v.s
46
- if name.id == '__license__':
47
- __license__ = v.s
48
- if name.id == '__author__':
49
- __author__ = v.s
50
- if name.id == '__author_email__':
51
- __author_email__ = v.s
52
-
53
-
54
- setup(
55
- name="navigator-session",
56
- version=__version__,
57
- python_requires=">=3.9.13",
58
- url="https://github.com/phenobarbital/navigator-session",
59
- description=__description__,
60
- keywords=['asyncio', 'session', 'aioredis', 'aiohttp'],
61
- platforms=['POSIX'],
62
- long_description=readme(),
63
- long_description_content_type='text/markdown',
64
- classifiers=[
65
- "Development Status :: 4 - Beta",
66
- "Intended Audience :: Developers",
67
- "Operating System :: POSIX :: Linux",
68
- "Environment :: Web Environment",
69
- "Topic :: Software Development :: Build Tools",
70
- "Topic :: Software Development :: Libraries :: Python Modules",
71
- "Topic :: Database :: Front-Ends",
72
- "Programming Language :: Python :: 3.9",
73
- "Programming Language :: Python :: 3.10",
74
- "Programming Language :: Python :: 3.11",
75
- "Programming Language :: Python :: 3.12",
76
- "Framework :: AsyncIO",
77
- "Framework :: aiohttp",
78
- ],
79
- author=__author__,
80
- author_email=__author_email__,
81
- packages=find_packages(exclude=["contrib", "docs", "tests"]),
82
- license=__license__,
83
- setup_requires=[
84
- 'setuptools==74.0.0',
85
- 'Cython==3.0.11',
86
- 'wheel==0.44.0'
87
- ],
88
- install_requires=[
89
- "aiohttp>=3.9.5",
90
- "asyncio==3.4.3",
91
- "jsonpickle>=3.0.2",
92
- "redis>=5.0.4",
93
- "python_datamodel>=0.7.0",
94
- "navconfig[default]>=1.7.0",
95
- ],
96
- project_urls={ # Optional
97
- "Source": "https://github.com/phenobarbital/navigator-session",
98
- "Funding": "https://paypal.me/phenobarbital",
99
- "Say Thanks!": "https://saythanks.io/to/phenobarbital",
100
- },
101
- )