Skip to content

Fix missing mdoc, mso, & tests folders when installing on Windows. #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 17, 2025

Conversation

ljoy913
Copy link
Contributor

@ljoy913 ljoy913 commented Mar 14, 2025

When installing on Windows with pip install git+https://github.com/IdentityPython/pyMDOC-CBOR.git the mdoc, mso, and tests folders are missing from the installation leading to mdoc failures. This PR fixes the issue by updating the sub-packages detection in the setup.py file.

  • Updated sub-package detection in setup.py
  • Replaced deprecated utcnow calls causing warnings when running tests
  • Added __init__.py files to mdoc sub-package to aid detection

pytest --pyargs pymdoccbor.tests passes all tests without warnings

@@ -137,7 +137,7 @@ def sign(
:return: the signed mso
:rtype: Sign1Message
"""
utcnow = datetime.datetime.utcnow()
utcnow = datetime.datetime.now(datetime.UTC)
Copy link
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)

@@ -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
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
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(

Copy link
Contributor

@PascalDR PascalDR left a comment

Choose a reason for hiding this comment

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

It's better if we use timezone to retrieve the UTC class.

@peppelinux peppelinux merged commit 9fbf822 into IdentityPython:main Mar 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants