A SMTP server for use as a pytest fixture that implements encryption and authentication.

Overview

SMTPDFix: Test email, locally

build

A simple SMTP server based on aiosmtpd for use as a fixture with pytest that supports encryption and authentication. All this does is receives messages and appends them to a list as an email.Message.

Not intended for use with production systems.

This fixture is intended to address cases where to test an application that sends an email, it needs to be intercepted for subsequent processing. For example, sending an email with a code for password reset or two-factor authentication. This fixture allows a test to trigger the email being sent, ensure that it's sent, and read the email.

Installing

To install using pip, first upgrade pip to the latest version to avoid any issues installing cryptography:

$ python -m pip install --upgrade pip
$ pip install smtpdfix

Or, if you're using setuptools, it can be included in the extras_require argument of a setup.py file:

setup(
    ...
    extras_require={
        "test": [
            "pytest",
            "smtpdfix",
        ],
    },
)

and then installed with pip (-e assumes that you want your project to be editable):

$ python -m pip install --upgrade pip
$ pip install -e .[test]

Using

The SMTPDFix plugin, smtpd, automatically registers for use with pytest when you install smtpdfix. To use it simply add to you test method.

from smtplib import SMTP


def test_sendmail(smtpd):
    from_addr = "[email protected]"
    to_addrs = "[email protected]"
    msg = (f"From: {from_addr}\r\n"
           f"To: {to_addrs}\r\n"
           f"Subject: Foo\r\n\r\n"
           f"Foo bar")

    with SMTP(smtpd.hostname, smtpd.port) as client:
        client.sendmail(from_addr, to_addrs, msg)

    assert len(smtpd.messages) == 1

To use STARTTLS:

from smtplib import SMTP


def test_sendmail(smtpd):
    smptd.config.use_starttls = True
    from_ = "[email protected]"
    to_ = "[email protected]"
    msg = (f"From: {from_}\r\n"
           f"To: {to_}\r\n"
           f"Subject: Foo\r\n\r\n"
           f"Foo bar")

    with SMTP(smtpd.hostname, smtpd.port) as client:
        client.starttls()  # Note that you need to call starttls first.
        client.sendmail(from_addr, to_addrs, msg)

    assert len(smtpd.messages) == 1

As of version 0.2.7 the plugin automatically registers and it is not necessary to include it manually by adding pytest_plugins = "smtpdfix" to the module or conftest.py.

The certificates included with the fixture will work for addresses localhost, localhost.localdomain, 127.0.0.1, 0.0.0.1, ::1. If using other addresses the key (key.pem) and certificate (cert.pem) must be in a location specified under SMTP_SSL_CERTS_PATH.

Not as a fixture

In some situations it may be desirable to not use the fixture which is initialized before entering the test. This can be accomplished by using the SMTPDFix class.

from smtplib import SMTP

from smtpdfix import SMTPDFix


def test_smtpdfix(msg):
    hostname, port = "127.0.0.1", 8025

    with SMTPDFix(hostname, port) as smtpd:
        with SMTP(hostname, port) as client:
            from_addr = "[email protected]"
            to_addrs = "[email protected]"
            msg = (f"From: {from_addr}\r\n"
                   f"To: {to_addrs}\r\n"
                   f"Subject: Foo\r\n\r\n"
                   f"Foo bar")

            client.sendmail(from_addr, to_addrs, msg)

        assert len(smtpd.messages) == 1

Configuration

Configuration is handled through properties in the config of the fixture and are initially set from environment variables:

Property Variable Default Description
host SMTPD_HOST 127.0.0.1 or ::1 The hostname that the fixture will listen on.
port SMTPD_PORT 8025 The port that the fixture will listen on.
ready_timeout SMTPD_READY_TIMEOUT 5.0 The seconds the server will wait to start before raising a TimeoutError.
login_username SMTPD_LOGIN_NAME user
login_password SMTPD_LOGIN_PASSWORD password
use_ssl SMTPD_USE_SSL False Whether the fixture should use fixed TLS/SSL for transactions. If using smtplib requires that SMTP_SSL be used instead of SMTP.
use_starttls SMTPD_USE_STARTTLS False Whether the fixture should use StartTLS to encrypt the connections. If using smtplib requires that SMTP.starttls() is called before other commands are issued. Overrides use_tls as the preferred method for securing communications with the client.
enforce_auth SMTPD_ENFORCE_AUTH False If set to true then the fixture refuses MAIL, RCPT, DATA commands until authentication is completed.
ssl_cert_path SMTPD_SSL_CERTS_PATH ./certs/ The path to the key and certificate in PEM format for encryption with SSL/TLS or StartTLS.
ssl_cert_files SMTPD_SSL_CERT_FILE and SMTPD_SSL_KEY_FILE ("cert.pem", None) A tuple of the path for the certificate file and key file in PEM format. See Resolving certificate and key paths for more details.

If environment variables are included in a .env file they'll be loaded automatically.

Resolving certificate and key paths

In order to resolve the certificate and key paths for the SSL/TLS context SMTPDFix does the following:

  1. On initialization of a smtpdfix.Config the ssl_cert_path is set by the SMTPD_SSL_CERTS_PATH environment variable and the ssl_cert_files is set to a tuple of (SMTPD_SSL_CERT_FILE and SMTPD_SSL_KEY_FILE). If the environment variables are not set the deafults are used.
  2. If an SSL Context is needed, when the smptdfix.AuthController is initialized it will attempt to find the files in the following sequence for both the certificate file and the key file:
    1. If the value in ssl_cert_files is None then None is returned. Setting the key file to be none assumes that it has been included in the certificate file.
    2. If the value in ssl_cert_files is a valid path to a file then this is returned.
    3. ssl_cert_path and the value from ssl_cert_files are joined and returned if it a valid path to a file.
    4. A FileNotFoundError is raised.

An example, assuming that the certificate and key are written in a single PEM file located at ./certificates/localhost.cert.pem would be:

from smtplib import STMP_SSL


def test_custom_certificate(smtpd):
    smtpd.config.ssl_cert_files = "./certificates/localhost.cert.pem"
    smtpd.config.use_ssl = True

    from_ = "[email protected]"
    to_ = "[email protected]"
    msg = (f"From: {from_}\r\n"
           f"To: {to_}\r\n"
           f"Subject: Foo\r\n\r\n"
           f"Foo bar")

    with SMTP_SSL(smtpd.hostname, smtpd.port) as client:
        client.sendmail(from_addr, to_addrs, msg)

    assert len(smtpd.messages) == 1

Alternatives

Many libraries for sending email have built-in methods for testing and using these methods should generally be prefered over SMTPDFix. Some known solutions:

Developing

To develop and test smtpdfix you will need to install pytest-asyncio to run asynchronous tests, isort to sort imports and flake8 to lint. To install in a virtual environment for development:

$ python -m venv venv
$ ./venv/scripts/activate
$ pip install -e .[dev]

Code is tested using tox:

$ tox

Quick tests can be handled by running pytest directly:

$ pytest -p no:smtpd --cov

Before submitting a pull request with your changes you should ensure that all imports are sorted and that the code passes linting with flake8.

$ isort .
$ flake8 .

If you have upgraded or added any requirements you should add them to setup.py along with the minimal constraints needed for the functionality. The requirements.txt file can then be updated by running:

$ bash ./scripts/fix-requirements.sh .

Known Issues

  • Firewalls may interfere with the operation of the smtp server.
  • Authenticating with LOGIN and PLAIN mechanisms fails over TLS/SSL, but works with STARTTLS. Issue #10
  • Currently no support for termination through signals. Issue #4
  • If the fixture start exceeds the ready_timeout and aborts the host and port are not consistently released and subsequent uses may result in an error. Issue #80

©2020-2021, Written with and in Montreal, QC

Issues
  • Bump isort from 5.6.4 to 5.7.0

    Bump isort from 5.6.4 to 5.7.0

    Bumps isort from 5.6.4 to 5.7.0.

    Release notes

    Sourced from isort's releases.

    5.7.0 December 30th 2020

    • Fixed #1612: In rare circumstances an extra comma is added after import and before comment.
    • Fixed #1593: isort encounters bug in Python 3.6.0.
    • Implemented #1596: Provide ways for extension formatting and file paths to be specified when using streaming input from CLI.
    • Implemented #1583: Ability to output and diff within a single API call to isort.file.
    • Implemented #1562, #1592 & #1593: Better more useful fatal error messages.
    • Implemented #1575: Support for automatically fixing mixed indentation of import sections.
    • Implemented #1582: Added a CLI option for skipping symlinks.
    • Implemented #1603: Support for disabling float_to_top from the command line.
    • Implemented #1604: Allow toggling section comments on and off for indented import sections.
    Changelog

    Sourced from isort's changelog.

    5.7.0 December 30th 2020

    • Fixed #1612: In rare circumstances an extra comma is added after import and before comment.
    • Fixed #1593: isort encounters bug in Python 3.6.0.
    • Implemented #1596: Provide ways for extension formatting and file paths to be specified when using streaming input from CLI.
    • Implemented #1583: Ability to output and diff within a single API call to isort.file.
    • Implemented #1562, #1592 & #1593: Better more useful fatal error messages.
    • Implemented #1575: Support for automatically fixing mixed indentation of import sections.
    • Implemented #1582: Added a CLI option for skipping symlinks.
    • Implemented #1603: Support for disabling float_to_top from the command line.
    • Implemented #1604: Allow toggling section comments on and off for indented import sections.
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 5
  • Bump actions/setup-python from 2.3.1 to 2.3.2

    Bump actions/setup-python from 2.3.1 to 2.3.2

    Bumps actions/setup-python from 2.3.1 to 2.3.2.

    Release notes

    Sourced from actions/setup-python's releases.

    Update primary and restore keys for pip

    In scope of this release we include a version of python in restore and primary cache keys for pip. Besides, we add temporary fix for Windows caching issue, that the pip cache dir command returns non zero exit code or writes to stderr. Moreover we updated node-fetch dependency.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 4
  • Bump actions/setup-python from 3.1.2 to 4

    Bump actions/setup-python from 3.1.2 to 4

    Bumps actions/setup-python from 3.1.2 to 4.

    Release notes

    Sourced from actions/setup-python's releases.

    v4.0.0

    What's Changed

    • Support for python-version-file input: #336

    Example of usage:

    - uses: actions/[email protected]
      with:
        python-version-file: '.python-version' # Read python version from a file
    - run: python my_script.py
    

    There is no default python version for this setup-python major version, the action requires to specify either python-version input or python-version-file input. If the python-version input is not specified the action will try to read required version from file from python-version-file input.

    • Use pypyX.Y for PyPy python-version input: #349

    Example of usage:

    - uses: actions/[email protected]
      with:
        python-version: 'pypy3.9' # pypy-X.Y kept for backward compatibility
    - run: python my_script.py
    
    • RUNNER_TOOL_CACHE environment variable is equal AGENT_TOOLSDIRECTORY: #338

    • Bugfix: create missing pypyX.Y symlinks: #347

    • PKG_CONFIG_PATH environment variable: #400

    • Added python-path output: #405 python-path output contains Python executable path.

    • Updated zeit/ncc to vercel/ncc package: #393

    • Bugfix: fixed output for prerelease version of poetry: #409

    • Made pythonLocation environment variable consistent for Python and PyPy: #418

    • Bugfix for 3.x-dev syntax: #417

    • Other improvements: #318 #396 #384 #387 #388

    Commits
    • d09bd5e fix: 3.x-dev can install a 3.y version (#417)
    • f72db17 Made env.var pythonLocation consistent for Python and PyPy (#418)
    • 53e1529 add support for python-version-file (#336)
    • 3f82819 Fix output for prerelease version of poetry (#409)
    • 397252c Update zeit/ncc to vercel/ncc (#393)
    • de977ad Merge pull request #412 from vsafonkin/v-vsafonkin/fix-poetry-cache-test
    • 22c6af9 Change PyPy version to rebuild cache
    • 081a3cf Merge pull request #405 from mayeut/interpreter-path
    • ff70656 feature: add a python-path output
    • fff15a2 Use pypyX.Y for PyPy python-version input (#349)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 3
  • Bump actions/setup-python from 2.3.2 to 3

    Bump actions/setup-python from 2.3.2 to 3

    Bumps actions/setup-python from 2.3.2 to 3.

    Release notes

    Sourced from actions/setup-python's releases.

    v3.0.0

    What's Changed

    Breaking Changes

    With the update to Node 16, all scripts will now be run with Node 16 rather than Node 12.

    This new major release removes support of legacy pypy2 and pypy3 keywords. Please use more specific and flexible syntax to specify a PyPy version:

    jobs:
      build:
        runs-on: ubuntu-latest
        strategy:
          matrix:
            python-version:
            - 'pypy-2.7' # the latest available version of PyPy that supports Python 2.7
            - 'pypy-3.8' # the latest available version of PyPy that supports Python 3.8
            - 'pypy-3.8-v7.3.8' # Python 3.8 and PyPy 7.3.8
        steps:
        - uses: actions/[email protected]
        - uses: actions/[email protected]
          with:
            python-version: ${{ matrix.python-version }}
    

    See more usage examples in the documentation

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 2
  • Bump ossf/scorecard-action from 1.0.3 to 1.0.4

    Bump ossf/scorecard-action from 1.0.3 to 1.0.4

    Bumps ossf/scorecard-action from 1.0.3 to 1.0.4.

    Release notes

    Sourced from ossf/scorecard-action's releases.

    v1.0.4

    Summary

    This release fixes null repository and branch issues: see ossf/scorecard-action#106, ossf/scorecard-action#84 and ossf/scorecard-action#73

    What's Changed

    New Contributors

    Full Changelog: https://github.com/ossf/scorecard-action/compare/v1.0.3...v1.0.4

    Commits
    • c1aec4a :seedling: Verify clean env in build
    • 750f598 :seedling: Dependabot for go
    • 322c6e0 :seedling: Final bits of porting the shell to go
    • 5b4ee38 Bump actions/setup-go from 2.1.5 to 2.2.0
    • 0550e75 Bump github/codeql-action from 1.0.32 to 1.1.0
    • 9e79f66 :seedling: Porting of shell script to go
    • 60701bb ./entrypoints.sh: updated SCORECARD_IS_FORK (#98)
    • 869bc60 :seedling: More unit tests for porting to Go
    • 57f3e8a :seedling: Porting shell script to Go
    • 682b53e :seedling: Porting shell script to Go
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 2
  • Bump pytest from 6.2.5 to 7.0.0

    Bump pytest from 6.2.5 to 7.0.0

    Bumps pytest from 6.2.5 to 7.0.0.

    Release notes

    Sourced from pytest's releases.

    7.0.0

    pytest 7.0.0 (2022-02-03)

    (Please see the full set of changes for this release also in the 7.0.0rc1 notes below)

    Deprecations

    • #9488: If custom subclasses of nodes like pytest.Item{.interpreted-text role="class"} override the __init__ method, they should take **kwargs. See uncooperative-constructors-deprecated{.interpreted-text role="ref"} for details.

      Note that a deprection warning is only emitted when there is a conflict in the arguments pytest expected to pass. This deprecation was already part of pytest 7.0.0rc1 but wasn't documented.

    Bug Fixes

    • #9355: Fixed error message prints function decorators when using assert in Python 3.8 and above.
    • #9396: Ensure pytest.Config.inifile{.interpreted-text role="attr"} is available during the pytest_cmdline_main <_pytest.hookspec.pytest_cmdline_main>{.interpreted-text role="func"} hook (regression during 7.0.0rc1).

    Improved Documentation

    • #9404: Added extra documentation on alternatives to common misuses of [pytest.warns(None)]{.title-ref} ahead of its deprecation.
    • #9505: Clarify where the configuration files are located. To avoid confusions documentation mentions that configuration file is located in the root of the repository.

    Trivial/Internal Changes

    • #9521: Add test coverage to assertion rewrite path.

    pytest 7.0.0rc1 (2021-12-06)

    Breaking Changes

    • #7259: The Node.reportinfo() <non-python tests>{.interpreted-text role="ref"} function first return value type has been expanded from [py.path.local | str]{.title-ref} to [os.PathLike[str] | str]{.title-ref}.

      Most plugins which refer to [reportinfo()]{.title-ref} only define it as part of a custom pytest.Item{.interpreted-text role="class"} implementation. Since [py.path.local]{.title-ref} is a [os.PathLike[str]]{.title-ref}, these plugins are unaffacted.

      Plugins and users which call [reportinfo()]{.title-ref}, use the first return value and interact with it as a [py.path.local]{.title-ref}, would need to adjust by calling [py.path.local(fspath)]{.title-ref}. Although preferably, avoid the legacy [py.path.local]{.title-ref} and use [pathlib.Path]{.title-ref}, or use [item.location]{.title-ref} or [item.path]{.title-ref}, instead.

      Note: pytest was not able to provide a deprecation period for this change.

    ... (truncated)

    Commits
    • 3554b83 Add note to changelog
    • 6ea7f99 Prepare release version 7.0.0
    • 737b220 [7.0.x] releasing: Add template for major releases (#9597)
    • 7fa3972 [7.0.x] releasing: Always set doc_version (#9590)
    • b304499 [7.0.x] Make 'warnings' and 'deselected' in assert_outcomes optional (#9566)
    • f17525d [7.0.x] doc: Add ellipsis to warning usecase list (#9562)
    • 0a7be97 ci: Bump up timeout (#9565)
    • c17908c [7.0.x] doc: Recategorize 7.0.0 changelog items (#9564)
    • ab549bb [7.0.x] Add missing cooperative constructor changelog (#9563)
    • 4b1707f [7.0.x] Autouse linearization graph (#9557)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • Bump pyparsing from 3.0.6 to 3.0.7

    Bump pyparsing from 3.0.6 to 3.0.7

    Bumps pyparsing from 3.0.6 to 3.0.7.

    Release notes

    Sourced from pyparsing's releases.

    pyparsing 3.0.7

    • Fixed bug #345, in which delimitedList changed expressions in place using expr.streamline(). Reported by Kim Gräsman, thanks!

    • Fixed bug #346, when a string of word characters was passed to WordStart or WordEnd instead of just taking the default value. Originally posted as a question by Parag on StackOverflow, good catch!

    • Fixed bug #350, in which White expressions could fail to match due to unintended whitespace-skipping. Reported by Fu Hanxi, thank you!

    • Fixed bug #355, when a QuotedString is defined with characters in its quoteChar string containing regex-significant characters such as ., *, ?, [, ], etc.

    • Fixed bug in ParserElement.run_tests where comments would be displayed using with_line_numbers.

    • Added optional "min" and "max" arguments to delimited_list. PR submitted by Marius, thanks!

    • Added new API change note in whats_new_in_pyparsing_3_0_0, regarding a bug fix in the bool() behavior of ParseResults.

      Prior to pyparsing 3.0.x, the ParseResults class implementation of __bool__ would return False if the ParseResults item list was empty, even if it contained named results. In 3.0.0 and later, ParseResults will return True if either the item list is not empty or if the named results dict is not empty.

      # generate an empty ParseResults by parsing a blank string with
      # a ZeroOrMore
      result = Word(alphas)[...].parse_string("")
      print(result.as_list())
      print(result.as_dict())
      print(bool(result))
      

      add a results name to the result

      result["name"] = "empty result" print(result.as_list()) print(result.as_dict()) print(bool(result))

      Prints:

      []
      {}
      False
      

      [] {'name': 'empty result'} True

      In previous versions, the second call to bool() would return False.

    • Minor enhancement to Word generation of internal regular expression, to emit consecutive characters in range, such as "ab", as "ab", not "a-b".

    • Fixed character ranges for search terms using non-Western characters in booleansearchparser, PR submitted by tc-yu, nice work!

    • Additional type annotations on public methods.

    Changelog

    Sourced from pyparsing's changelog.

    Version 3.0.7 -

    • Fixed bug #345, in which delimitedList changed expressions in place using expr.streamline(). Reported by Kim Gräsman, thanks!

    • Fixed bug #346, when a string of word characters was passed to WordStart or WordEnd instead of just taking the default value. Originally posted as a question by Parag on StackOverflow, good catch!

    • Fixed bug #350, in which White expressions could fail to match due to unintended whitespace-skipping. Reported by Fu Hanxi, thank you!

    • Fixed bug #355, when a QuotedString is defined with characters in its quoteChar string containing regex-significant characters such as ., *, ?, [, ], etc.

    • Fixed bug in ParserElement.run_tests where comments would be displayed using with_line_numbers.

    • Added optional "min" and "max" arguments to delimited_list. PR submitted by Marius, thanks!

    • Added new API change note in whats_new_in_pyparsing_3_0_0, regarding a bug fix in the bool() behavior of ParseResults.

      Prior to pyparsing 3.0.x, the ParseResults class implementation of __bool__ would return False if the ParseResults item list was empty, even if it contained named results. In 3.0.0 and later, ParseResults will return True if either the item list is not empty or if the named results dict is not empty.

      # generate an empty ParseResults by parsing a blank string with
      # a ZeroOrMore
      result = Word(alphas)[...].parse_string("")
      print(result.as_list())
      print(result.as_dict())
      print(bool(result))
      

      add a results name to the result

      result["name"] = "empty result" print(result.as_list()) print(result.as_dict()) print(bool(result))

      Prints:

      []
      {}
      False
      

    ... (truncated)

    Commits
    • 938f59d Fixed IndentedBlock internal parse action to use correct value of cur
    • 236cb8b Fixed exception generated in a ParserElementEnhance if the contained expr is ...
    • 5fb6e0d Fix #355 - needed re.escape, not escape_regex_range_chars in QuotedString
    • 1ccf846 Issue #350 - fixed whitespace skipping around White expressions
    • 30bd0f3 Some code cleanup, replacing map() calls with list comprehensions; better typ...
    • 5771459 Fixed bug in ParserElement.run_tests where comments would be displayed using ...
    • 5e3e1bb Fixed PEP-8 compatibility logic in WordStart and WordEnd (Issue #346)
    • 3a12ded Update CHANGES doc with latest PR
    • d72bd46 Fixing Unicode block range in examples/booleansearchparser.py (#342)
    • 2f633f4 Fix #345 - delimitedList calling streamline() changes content of expr in some...
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • Bump attrs from 21.2.0 to 21.3.0

    Bump attrs from 21.2.0 to 21.3.0

    Bumps attrs from 21.2.0 to 21.3.0.

    Release notes

    Sourced from attrs's releases.

    21.3.0

    This is a big release in the history of attrs and finishes an arc that took way too long and also delayed this very overdue release. But it's done: import attrs that has been talked about for years[^issue], but fell victim to “just this one more thing” has finally landed.

    From now on, modern attrs code looks like this:

    from attrs import define
    

    @​define class HelloWorld: modern: bool = True

    The define/field APIs have been around for over a year and were very popular, now the rest of the package followed suit. I'm very excited that attrs remains relevant and keeps evolving over now more than half a decade. If you're curious about some of the background, the docs now contain a short explanation and history lesson. As long as our users keep pushing us, we will keep pushing forward class generation in Python!

    Big thanks to my GitHub Sponsors, Tidelift subscribers, and Ko-fi buyers that help me mustering the motivation for such long-running project!


    Since the release took so long, there's more highlights than we can enumerate here, we'd just like to point out a breaking change in the new APIs: converters now run on setting attributes by default. If this is causing problems to you, you can disable that behavior by setting @define(on_setattr=[]).

    [^issue]: I have an issue from 2018 that I wanted to "come back the moment this lands".

    Full Changelog

    Backward-incompatible Changes

    • When using @define, converters are now run by default when setting an attribute on an instance -- additionally to validators. I.e. the new default is on_setattr=[attrs.setters.convert, attrs.setters.validate].

      This is unfortunately a breaking change, but it was an oversight, impossible to raise a DeprecationWarning about, and it's better to fix it now while the APIs are very fresh with few users. #835, #886

    • import attrs has finally landed! As of this release, you can finally import attrs using its proper name.

      Not all names from the attr namespace have been transferred; most notably attr.s and attr.ib are missing. See attrs.define and attrs.field if you haven't seen our next-generation APIs yet. A more elaborate explanation can be found On The Core API Names

      This feature is at least for one release provisional. We don't plan on changing anything, but such a big change is unlikely to go perfectly on the first strike.

      The API docs have been mostly updated, but it will be an ongoing effort to change everything to the new APIs. Please note that we have not moved -- or even removed -- anything from attr!

      Please do report any bugs or documentation inconsistencies! #887

    Changes

    • attr.asdict(retain_collection_types=False) (default) dumps collection-esque keys as tuples. #646, #888
    • __match_args__ are now generated to support Python 3.10's Structural Pattern Matching. This can be controlled by the match_args argument to the class decorators on Python 3.10 and later. On older versions, it is never added and the argument is ignored. #815
    • If the class-level on_setattr is set to attrs.setters.validate (default in @define and @mutable) but no field defines a validator, pretend that it's not set. #817
    • The generated __repr__ is significantly faster on Pythons with f-strings. #819
    • Attributes transformed via field_transformer are wrapped with AttrsClass again. #824
    • Generated source code is now cached more efficiently for identical classes. #828
    • Added attrs.converters.to_bool(). #830

    ... (truncated)

    Changelog

    Sourced from attrs's changelog.

    21.3.0 (2021-12-28)

    Backward-incompatible Changes ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    • When using @define, converters are now run by default when setting an attribute on an instance -- additionally to validators. I.e. the new default is on_setattr=[attrs.setters.convert, attrs.setters.validate].

      This is unfortunately a breaking change, but it was an oversight, impossible to raise a DeprecationWarning about, and it's better to fix it now while the APIs are very fresh with few users. [#835](https://github.com/python-attrs/attrs/issues/835) <https://github.com/python-attrs/attrs/issues/835>, [#886](https://github.com/python-attrs/attrs/issues/886) <https://github.com/python-attrs/attrs/issues/886>

    • import attrs has finally landed! As of this release, you can finally import attrs using its proper name.

      Not all names from the attr namespace have been transferred; most notably attr.s and attr.ib are missing. See attrs.define and attrs.field if you haven't seen our next-generation APIs yet. A more elaborate explanation can be found On The Core API Names <https://www.attrs.org/en/latest/names.html>_

      This feature is at least for one release provisional. We don't plan on changing anything, but such a big change is unlikely to go perfectly on the first strike.

      The API docs have been mostly updated, but it will be an ongoing effort to change everything to the new APIs. Please note that we have not moved -- or even removed -- anything from attr!

      Please do report any bugs or documentation inconsistencies! [#887](https://github.com/python-attrs/attrs/issues/887) <https://github.com/python-attrs/attrs/issues/887>_

    Changes ^^^^^^^

    • attr.asdict(retain_collection_types=False) (default) dumps collection-esque keys as tuples. [#646](https://github.com/python-attrs/attrs/issues/646) <https://github.com/python-attrs/attrs/issues/646>, [#888](https://github.com/python-attrs/attrs/issues/888) <https://github.com/python-attrs/attrs/issues/888>
    • __match_args__ are now generated to support Python 3.10's Structural Pattern Matching <https://docs.python.org/3.10/whatsnew/3.10.html#pep-634-structural-pattern-matching>. This can be controlled by the match_args argument to the class decorators on Python 3.10 and later. On older versions, it is never added and the argument is ignored. [#815](https://github.com/python-attrs/attrs/issues/815) <https://github.com/python-attrs/attrs/issues/815>
    • If the class-level on_setattr is set to attrs.setters.validate (default in @define and @mutable) but no field defines a validator, pretend that it's not set. [#817](https://github.com/python-attrs/attrs/issues/817) <https://github.com/python-attrs/attrs/issues/817>_
    • The generated __repr__ is significantly faster on Pythons with f-strings. [#819](https://github.com/python-attrs/attrs/issues/819) <https://github.com/python-attrs/attrs/issues/819>_
    • Attributes transformed via field_transformer are wrapped with AttrsClass again. [#824](https://github.com/python-attrs/attrs/issues/824) <https://github.com/python-attrs/attrs/issues/824>_
    • Generated source code is now cached more efficiently for identical classes. [#828](https://github.com/python-attrs/attrs/issues/828) <https://github.com/python-attrs/attrs/issues/828>_
    • Added attrs.converters.to_bool(). [#830](https://github.com/python-attrs/attrs/issues/830) <https://github.com/python-attrs/attrs/issues/830>_

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • Bump actions/setup-python from 2.2.2 to 2.3.0

    Bump actions/setup-python from 2.2.2 to 2.3.0

    Bumps actions/setup-python from 2.2.2 to 2.3.0.

    Release notes

    Sourced from actions/setup-python's releases.

    Support caching dependencies

    This release introduces dependency caching support (actions/setup-python#266)

    Caching dependencies.

    The action has a built-in functionality for caching and restoring pip/pipenv dependencies. The cache input is optional, and caching is turned off by default.

    Besides, this release introduces dependency caching support for mono repos and repositories with complex structure.

    By default, the action searches for the dependency file (requirements.txt for pip or Pipfile.lock for pipenv) in the whole repository. Use the cache-dependency-path input for cases when you want to override current behaviour and use different file for hash generation (for example requirements-dev.txt). This input supports wildcards or a list of file names for caching multiple dependencies.

    Caching pip dependencies:

    steps:
    - uses: actions/[email protected]
    - uses: actions/[email protected]
      with:
        python-version: '3.9'
        cache: 'pip'
    - run: pip install -r requirements.txt
    - run: pip test
    

    Caching pipenv dependencies:

    steps:
    - uses: actions/[email protected]
    - name: Install pipenv
      run: pipx install pipenv
    - uses: actions/[email protected]
      with:
        python-version: '3.9'
        cache: 'pipenv'
    - run: pipenv install
    - run: pipenv test
    

    Change dependency file:

    steps:
    - uses: actions/[email protected]
    - uses: actions/[email protected]
      with:
        python-version: '3.9'
        cache: 'pip'
        cache-dependency-path: '**/requirements-dev.txt'
    - run: pip install -r subdirectory/requirements-dev.txt
    - run: pip test
    
    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 2
  • Bump pycparser from 2.20 to 2.21

    Bump pycparser from 2.20 to 2.21

    Bumps pycparser from 2.20 to 2.21.

    Changelog

    Sourced from pycparser's changelog.

    • Version 2.21 (2021.11.06)

      • Much improved support for C11 (multiple PRs)
      • Support for parehthesized compount statements (#423)
      • Support for modern Python versions (3.9 and 3.10)
      • Fix support for structs with nested enums (#387)
      • Multiple small bug fixes
    Commits
    • 3cf6bf5 Update TODO to mention bdist_wheel
    • 7593f34 Update TODO with distribution testing instructions
    • b400c00 Preparation for releasing 2.21
    • f19cd14 Don't run cpp/gcc-needing tests on Darwin: not all Macs have the tools
    • 268067b Only run example tests on Linux, since many require cpp
    • 43997f1 Try to make func_calls example pass on all platforms with no arguments
    • 7beef72 Add test that runs all examples and makes sure they don't crash
    • 615317a Merge branch 'master' of github.com:eliben/pycparser
    • 50dac81 Clarify README w.r.t. C11 support in fake headers
    • a7b480c Fix typos (#443)
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • Bump pyparsing from 3.0.0 to 3.0.3

    Bump pyparsing from 3.0.0 to 3.0.3

    Bumps pyparsing from 3.0.0 to 3.0.3.

    Release notes

    Sourced from pyparsing's releases.

    pyparsing 3.0.3

    • Fixed regex typo in one_of fix for as_keyword=True.

    • Fixed a whitespace-skipping bug, Issue #319, introduced as part of the revert of the LineStart changes. Reported by Marc-Alexandre Côté, thanks!

    • Added header column labeling > 100 in with_line_numbers - some input lines are longer than others.

    pyparsing 3.0.2

    • Reverted change in behavior with LineStart and StringStart, which changed the interpretation of when and how LineStart and StringStart should match when a line starts with spaces. In 3.0.0, the xxxStart expressions were not really treated like expressions in their own right, but as modifiers to the following expression when used like LineStart() + expr, so that if there were whitespace on the line before expr (which would match in versions prior to 3.0.0), the match would fail.

      3.0.0 implemented this by automatically promoting LineStart() + expr to AtLineStart(expr), which broke existing parsers that did not expect expr to necessarily be right at the start of the line, but only be the first token found on the line. This was reported as a regression in Issue #317.

      In 3.0.2, pyparsing reverts to the previous behavior, but will retain the new AtLineStart and AtStringStart expression classes, so that parsers can chose whichever behavior applies in their specific instance. Specifically:

      # matches expr if it is the first token on the line (allows for leading whitespace)
      LineStart() + expr
      

      matches only if expr is found in column 1

      AtLineStart(expr)

    • Performance enhancement to one_of to always generate an internal Regex, even if caseless or as_keyword args are given as True (unless explicitly disabled by passing use_regex=False).

    • IndentedBlock class now works with recursive flag. By default, the results parsed by an IndentedBlock are grouped. This can be disabled by constructing the IndentedBlock with grouped=False.

    pyparsing 3.0.1

    • Fixed bug where Word(max=n) did not match word groups less than length 'n'. Thanks to Joachim Metz for catching this!

    • Fixed bug where ParseResults accidentally created recursive contents. Joachim Metz on this one also!

    • Fixed bug where warn_on_multiple_string_args_to_oneof warning is raised even when not enabled.

    Changelog

    Sourced from pyparsing's changelog.

    Version 3.0.3 -

    • Fixed regex typo in one_of fix for as_keyword=True.

    • Fixed a whitespace-skipping bug, Issue #319, introduced as part of the revert of the LineStart changes. Reported by Marc-Alexandre Côté, thanks!

    • Added header column labeling > 100 in with_line_numbers - some input lines are longer than others.

    Version 3.0.2 -

    • Reverted change in behavior with LineStart and StringStart, which changed the interpretation of when and how LineStart and StringStart should match when a line starts with spaces. In 3.0.0, the xxxStart expressions were not really treated like expressions in their own right, but as modifiers to the following expression when used like LineStart() + expr, so that if there were whitespace on the line before expr (which would match in versions prior to 3.0.0), the match would fail.

      3.0.0 implemented this by automatically promoting LineStart() + expr to AtLineStart(expr), which broke existing parsers that did not expect expr to necessarily be right at the start of the line, but only be the first token found on the line. This was reported as a regression in Issue #317.

      In 3.0.2, pyparsing reverts to the previous behavior, but will retain the new AtLineStart and AtStringStart expression classes, so that parsers can chose whichever behavior applies in their specific instance. Specifically:

      # matches expr if it is the first token on the line
      # (allows for leading whitespace)
      LineStart() + expr
      

      matches only if expr is found in column 1

      AtLineStart(expr)

    • Performance enhancement to one_of to always generate an internal Regex, even if caseless or as_keyword args are given as True (unless explicitly disabled by passing use_regex=False).

    • IndentedBlock class now works with recursive flag. By default, the results parsed by an IndentedBlock are grouped. This can be disabled by constructing the IndentedBlock with grouped=False.

    Version 3.0.1 -

    • Fixed bug where Word(max=n) did not match word groups less than length 'n'.

    ... (truncated)

    Commits
    • bf17712 Update version time
    • b7f7f58 Added header column labeling > 100 in with_line_numbers
    • 1bbc832 Fix whitespace skipping bug introduced while reverting LineStart() changes - ...
    • 46f4af6 Fix regex typo in one_of (:? should be (?:
    • c218b88 Update version for next release
    • 6f13940 Update docs to reflect reverting LineStart and StringStart changes made in 3.0.0
    • 280f71a Fixed type annotation in IndentedBlock
    • 1be3b53 Fixed IndentedBlock
    • 4ab17bb Revert strict LineStart interpretation in 3.0.0 to 2.4.x behavior (Issue #317)
    • 8b3d958 To blacken
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 2
  • Bump actions/setup-python from 4.1.0 to 4.2.0

    Bump actions/setup-python from 4.1.0 to 4.2.0

    Bumps actions/setup-python from 4.1.0 to 4.2.0.

    Release notes

    Sourced from actions/setup-python's releases.

    Add check-latest input and bug fixes

    In scope of this release we add the check-latest input. If check-latest is set to true, the action first checks if the cached version is the latest one. If the locally cached version is not the most up-to-date, the version will then be downloaded from python-versions repository. By default check-latest is set to false. For PyPy it will to try to reach https://downloads.python.org/pypy/versions.json

    Example of usage:

    steps:
      - uses: actions/[email protected]
      - uses: actions/[email protected]
        with:
          python-version: '3.9'
          check-latest: true
      - run: python --version
    

    Besides, it includes such changes as

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies github_actions 
    opened by dependabot[bot] 0
  • Version 0.4.0 Release Checklist

    Version 0.4.0 Release Checklist

    This is a reminder checklist to ensure that everything has been done before release 0.4.0 is published:

    • [ ] Bump versions in \requirements\latest to latest versions.
    • [ ] __version__ updated to 0.4.0 in \smtpdfix\__init__.py
    • [ ] Release date set in \docs\CHANGELOG.md
    opened by bebleo 0
  • Socket does not consistently close on ready timeout

    Socket does not consistently close on ready timeout

    If the start of the server is aborted because the ready_timeout is exceeded the socket is not consistently closed down. when this happens subsequent uses fail with a message that the host and port are in use.

    bug 
    opened by bebleo 0
  • SMTP AUTH extension not supported by server.

    SMTP AUTH extension not supported by server.

    On Python 3.9.2 on macOS 11.2.1, using pytest 6.2.2 and smtpdfix 0.2.9, the following test fails with smtplib.SMTPNotSupportedError: SMTP AUTH extension not supported by server.. Uncommenting the line that sets SMTPD_ENFORCE_AUTH does not make a difference. The test succeeds if the client.login() line is removed.

    import smtplib
    
    def test_smtpdfix(monkeypatch, smtpd):
        #monkeypatch.setenv("SMTPD_ENFORCE_AUTH", "True")
        client = smtplib.SMTP()
        client.connect(smtpd.hostname, smtpd.port)
        client.login("user", "password")
        client.quit()
    
    documentation 
    opened by jwodder 1
  • PLAIN and LOGIN mechanisms refuse SSL encrypted requests

    PLAIN and LOGIN mechanisms refuse SSL encrypted requests

    When authenticating using the PLAIN and LOGIN authentication mechanisms over SSL/TLS authentication fails. It will succeed when running the server is using STARTTLS. The following test will fail:

    def test_AUTH_LOGIN_success(mock_smtpd_use_starttls, smtpd, user):
        with SMTP(smtpd.hostname, smtpd.port) as client:
            client.starttls()
            code, resp = client.docmd('AUTH', f'LOGIN {encode(user.username)}')
            assert code == 334
            assert resp == bytes(encode('Password'), 'ascii')
            code, resp = client.docmd(f'{encode(user.password)}')
            assert code == 235
    

    The following, however, fails:

    def test_AUTH_LOGIN_failure(mock_smtpd_use_ssl, smtpd, user):
        with SMTP_SSL(smtpd.hostname, smtpd.port) as client:
            code, resp = client.docmd('AUTH', f'LOGIN {encode(user.username)}')
            assert code == 334
            assert resp == bytes(encode('Password'), 'ascii')
            code, resp = client.docmd(f'{encode(user.password)}')
            assert code == 235  # Fails here because the code is "538 Authentication required."
    
    opened by bebleo 0
  • Add a received header to email messages

    Add a received header to email messages

    When the server receives email messages it should set a received header similar to the following:

    Received:     from maroon.pobox.com (maroon.pobox.com [208.72.237.40]) by mailstore.pobox.com 
            (Postfix) with ESMTP id 847989746 for <address>; Wed, 15 Jun 2011 10:42:09 -0400 (EDT)
    

    See this link for some examples.

    opened by bebleo 0
Releases(v0.3.3)
Owner
James Warne
James Warne
Mailrise is an SMTP server that converts the emails it receives into Apprise notifications

Mailrise is an SMTP server that converts the emails it receives into Apprise notifications. The intended use case is as an email relay for a home lab or network. By accepting ordinary email, Mailrise enables Linux servers, Internet of Things devices, surveillance systems, and outdated software to gain access to the full suite of 60+ notification services supported by Apprise, from Matrix to Nextcloud to your desktop or mobile device.

Ryan Young 196 Aug 4, 2022
Tempmail API aswell as a SMTP server.

Tempmail API/Server Tempmail API aswell as a SMTP server. Website · Report Bug · Request Feature Setup Firstly create a mongodb account, and proceed t

femboy.party 16 Mar 9, 2022
SMTP In some vulnerable configurations, email servers can also be aggregated Use information that gives us information about the host or network Give

SMTP In some vulnerable configurations, email servers can also be aggregated Use information that gives us information about the host or network Give. The SMTP protocol supports some basic commands such as VRFY and EXPN Slowly A VRFY request asks the server to verify an email address while Which requests an EXPN request for email list membership. These requests are The power is sometimes misused to verify the existence of a user on the email server Used by hackers later

m3hr44n 1 Jan 16, 2022
Python script for imap, pop3, smtp and IPv4 analyze

Python script for imap, pop3, smtp and IPv4 analyze

Vladislav Kotletkin 1 Jan 30, 2022
:incoming_envelope: IMAP/SMTP sync system with modern APIs

Nylas Sync Engine The Nylas Sync Engine provides a RESTful API on top of a powerful email sync platform, making it easy to build apps on top of email.

Nylas 3.5k Aug 11, 2022
Esio_dev 3 Oct 15, 2021
xxnx its a simple smtp tool for mails spaming

xxnx its a simple smtp tool for mails spaming what is smpt? Simple Mail Transfer Protocol or smtp service. The Simple Mail Transfer Protocol (SMTP) is

0xD4$H 3 Feb 27, 2022
Command line interface for sending email using SMTP (ships with Gmail configuration).

mailsend Description Lightweight command line interface for sending email using SMTP. Default configuration is set for Gmail (smtp.gmail.com at port 5

Keith Mathe 1 Mar 22, 2022
Django SMTP Protocol with Gmail

Django SMTP Protocol with Gmail This is the free service from gmail to send and receive emails. What we need for this things done, Python/pip install

Mehedi Hasan 1 Jan 26, 2022
Secret Service Email Encryption/Steganography

SecretService Decoy Encrypted Emailer

Unit 221B 6 Aug 5, 2022
GMailBomber is a form of Internet abuse which is perpetrated through the sending of massive volumes of email to a specific email address with the goal of overflowing the mailbox and overwhelming the mail server hosting the address, making it into some form of denial of service attack.

GMailBomber is a form of Internet abuse which is perpetrated through the sending of massive volumes of email to a specific email address with the goal of overflowing the mailbox and overwhelming the mail server hosting the address, making it into some form of denial of service attack.

Muneeb 5 Feb 23, 2022
A Python Mail Server

Salmon - A Python Mail Server Download: https://pypi.org/project/salmon-mail/ Source: https://github.com/moggers87/salmon Docs: https://salmon-mail.re

Matt Molyneaux 557 Aug 10, 2022
This is the mail server that handles responses from the Contact Form

mailserver About This is the mail server that handles responses from the Contact Form Contributors ✨ Thanks goes to these wonderful people (emoji key)

IoLang 3 Jan 3, 2022
A python mailserver meant for friends who value privacy and a hard to use interface....

python-mail A python mailserver meant for friends who value privacy and a hard to use interface.... Basic info This mailserver was just a random proje

Hashm 2 Jan 19, 2022
Use Django admin to manage drip campaign emails using querysets on Django's User model.

Django Drip Drip campaigns are pre-written sets of emails sent to customers or prospects over time. Django Drips lets you use the admin to manage drip

Zapier 627 Aug 2, 2022
Email-bomber - Email bomber unlike other email bombers u don't need your gmail email id to use this

Email-bomber - Email bomber unlike other email bombers u don't need your gmail email id to use this

rfeferfefe 49 Aug 11, 2022
Mailer is python3 script use for sending spear-phishing to target email...It was created by Spider Anongreyhat

Mailer Mailer is a python3 script. It's used for sending spear-phishing to target email...It was created by Spider Anongreyhat Screenshots Installatio

Spider Anongreyhat 26 Aug 15, 2022
Django email backends and webhooks for Amazon SES, Mailgun, Mailjet, Postmark, SendGrid, Sendinblue, SparkPost and more

Django email backends and webhooks for Amazon SES, Mailgun, Mailjet, Postmark, SendGrid, Sendinblue, SparkPost and more

null 1.3k Jul 26, 2022
You take an email and password from the combo list file and check it on mail.com

Brute-Force-mail tool information: Combo Type: email:pass Domains: All domains of the site Url: https://www.mail.com Api: ☑️ Proxy: No ☑️ The correct

null 6 Jun 5, 2022