Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
Empty file added pymdoccbor/mdoc/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion pymdoccbor/mso/issuer.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def sign(
:return: the signed mso
:rtype: Sign1Message
"""
utcnow = datetime.datetime.utcnow()
utcnow = datetime.datetime.now(datetime.UTC)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
utcnow = datetime.datetime.now(datetime.UTC)
utcnow = datetime.datetime.now(timezone.utc)

if settings.PYMDOC_EXP_DELTA_HOURS:
exp = utcnow + datetime.timedelta(
hours=settings.PYMDOC_EXP_DELTA_HOURS
Expand Down
4 changes: 2 additions & 2 deletions pymdoccbor/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@
X509_ORGANIZATION_NAME = os.getenv('X509_ORGANIZATION_NAME', u"My Company")
X509_COMMON_NAME = os.getenv('X509_COMMON_NAME', u"mysite.com")

X509_NOT_VALID_BEFORE = os.getenv('X509_NOT_VALID_BEFORE', datetime.datetime.utcnow())
X509_NOT_VALID_BEFORE = os.getenv('X509_NOT_VALID_BEFORE', datetime.datetime.now(datetime.UTC))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
X509_NOT_VALID_BEFORE = os.getenv('X509_NOT_VALID_BEFORE', datetime.datetime.now(datetime.UTC))
X509_NOT_VALID_BEFORE = os.getenv('X509_NOT_VALID_BEFORE', datetime.datetime.now(timezone.utc))

X509_NOT_VALID_AFTER_DAYS = os.getenv('X509_NOT_VALID_AFTER_DAYS', 10)
X509_NOT_VALID_AFTER = os.getenv(
'X509_NOT_VALID_AFTER',
datetime.datetime.utcnow() + datetime.timedelta(
datetime.datetime.now(datetime.UTC) + datetime.timedelta(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
datetime.datetime.now(datetime.UTC) + datetime.timedelta(
datetime.datetime.now(timezone.utc) + datetime.timedelta(

days=X509_NOT_VALID_AFTER_DAYS
)
)
Expand Down
16 changes: 4 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import re

from glob import glob
from setuptools import setup
from setuptools import setup, find_packages

def readme():
with open('README.md') as f:
Expand Down Expand Up @@ -31,15 +29,9 @@ def readme():
url='https://github.com/peppelinux/pyMDL-MDOC',
author='Giuseppe De Marco',
author_email='demarcog83@gmail.com',
license='License :: OSI Approved :: Apache Software License',
# scripts=[f'{_pkg_name}/bin/{_pkg_name}'],
packages=[f"{_pkg_name}"],
package_dir={f"{_pkg_name}": f"{_pkg_name}"},
package_data={f"{_pkg_name}": [
i.replace(f'{_pkg_name}/', '')
for i in glob(f'{_pkg_name}/**', recursive=True)
]
},
license='Apache Software License',
packages=find_packages(include=["pymdoccbor", "pymdoccbor.*"]),
include_package_data=True,
install_requires=[
'cbor2>=5.4.0,<5.5.0',
'cwt>=2.3.0,<2.4',
Expand Down