Skip to content
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

Small docs update #1

Closed
wants to merge 285 commits into from
Closed

Small docs update #1

wants to merge 285 commits into from

Conversation

waynew
Copy link
Owner

@waynew waynew commented Oct 12, 2023

I did a quick gander at the docs and didn't see any particular links against any specific Python version.

However, I'm pretty sure that some of the module :ref: links will fial against >=3.12, since smtpd is dropped there.

I also didn't confirm that any of the example docs match the (updated?) API/actual code.

The original names conflict with the auth_* mechanism handler methods.
Forgot an `await` keyboard resulting in trying to split a coroutine.

In the process of fixing that, I went a bit wild with type hinting to prevent
similar mistakes.

And while doing that, discovered potential problem if `login` is `None`
* RFC4954 specified "Enhanced Status Codes" for AUTH-related replies
* Also some status codes are semantically incorrect
* Correct pragma
* Proper venv exclusion
Asserts that keep happening with the exact same params are now collected in
`testing/helpers.py`

This will ease modification because these exact same params are now in one
place instead of distributed all over the tests.
On Windows, intializing the server takes quite some time, the original wait
was too short.

We extend the delay + parameterize it so it's tunable from one location.
We got 100% coverage with this one as we delve deep into
some internal logic.
Because `atpublic=2.0` (latest release as of this commit) _requires_ Python>=3.6
Only now do I understand what ${PLATFORM} means.
I have no other idea on how to do this. I mean, *many* test cases already
implicitly 'requires' the code to go through the branches. But coverage.py
doesn't seem to realize this.

I was left with no other option but to do "pragma: no branch"

Also, removed a no-longer-needed "pragma: nocover"
E133 is actually contrary to PEP8, which DOES allow closing brace/bracket/
parenthesis right under the first character of the line that starts the
multiline construct.[1]

W503 and W504 are conflicting with each other, and also prevent multiline
expressions within parentheses. The acrobatics required to not violate
both W503 and W504 will have seriously detrimental effects to the
readability of the code, so I disabled them.

Personal note: I really *really* REALLY want to change max-line-length to
90 as proposed by Raymond Hettinger in "Beyond PEP8"[2], but thankfully it's
not really necessary for aiosmtpd. I'll live. Fuming, but alive.

[1] https://www.python.org/dev/peps/pep-0008/#indentation
[2] https://www.youtube.com/watch?v=wf-BqAjZb8M
I figure I'll do this first to reduce technical debt.

Improvements & docs are to follow, Real Soon.
Previously, one will need to remember to change the indices. Adding (in-
sertion) and deleting (removal) affects the line and all lines following
that one.

Result: Big `git diff`, too many chaff that hide what actually happened.

With this change, you can easily add/remove/move around the expected
lines.
So I changed how I enumerate the handlers, wrote some additional tests,
and finally ensure that all tox scenarios pass.

Documentation has been updated to reflect this.
`login_data` is definitely more generic than `login_id`
... and somehow achieved an unbelievable **order-of-magnitude increase** in
performance! WHOA.

Behavioral changes:

* List of valid (non-excluded) AUTH hooks now created exactly once during
  class instantiation
* That means, you can no change the AUTH hooks "on the fly"
* Not that you can do that easily in previous versions anyways...

ALSO:

This passes all tests (including new ones I whup up to test AUTH hook
exclusion) and the all-important "qa" tox test.
This still passes all tox tests including qa
pepoluan and others added 26 commits December 22, 2022 12:40
It seems the last supported version for pypy36 is 0.5.0?
Co-authored-by: LGTM Migrator <lgtm-migrator@users.noreply.github.com>
* Add note on asyncore+asynchat deprecation
* Remove LGTM badge, Add Python Implementation badge
* Add downloads badges to PyPI description
* Some comment fixing in DESCRIPTION.rst
* Rename method to no longer shadow superclass attrib

Closes aio-libs#343 and aio-libs#344

* Remove double assignment

Already handled in the if..else

Closes aio-libs#345

* Remove double imports

Closes aio-libs#346

* Do something on handling of KeyboardInterrupt

Closes aio-libs#349

* Tighten up Protocol definition

Closes aio-libs#350

* Move ... to its own line

flake8 hates the tighter format

* Remove totally unused var & enumerate()

Closes aio-libs#351

* Add CodeQL badge to README and DESCRIPTION

I spent effort, I'm allowed to boast, dammit :D
Protect 1.4.3 from tainting if we accidentally released something from `master` 😁
* Support explicit specification of PyPy version

I can't stress how important envdir is.

tox managed to somehow b0rked my WHOLE aiosmtpd repo when I forgot to
explicitly specify the envdirs for pypy37 and pypy38

* Latest tox forces recreate if env changes

So our previous 'optimizations' to prevent reinstallation of packages are
rendered moot.

Let's optimize it the other way around then: Install only what's necessary.

Also since tox will recreate environments anyways, let's no longer use
per-python-version envdir; rather specify the full env name instead.

* Force using latest coverage.py

To ensure we get the PyPy v7.3.10 decorator-tracing fix.
* Drop testing for PyPy3.6, add PyPy3.9

Also force coverage version, and add comment about why coverage for PyPy3.8
is not done.

* Add PyPy versions to listed envnames

* Change example to use py37
* Workaround for asyncio.get_event_loop() deprecation

* Remove unused import in main.py

  That import was used only to get the current event loop.

  Now we handle that in `__init__.py`

* BUGFIX: if loop is not None then use that

  Also simplify the line because we have a helper func now

* Add pragma: no cover

  Because at the point the expected behavior is not yet happening.

* Update NEWS + bump to 1.4.4a1

* Don't ignore the warning, rather promote it into an error

* Some test cases to ensure the get event func works as intended

* Skip coverage only on Python<3.10

* Create new event loop only on failure

  Because apparently in Python<3.12, even though get_event_loop() raises a warning, it still returns existing event loop.

  The behavior is expected to change on Python>=3.12, so let's cut off at that point.

* More stringent testing for _get_or_new_eventloop

* FIX: Type hint for fixture should be Generator[]
Committed the wrong file, dang.
After careful consideration, it seems that pytype was actually complaining
of the possible "implicit return None" if a suitable value is not found
in the `for a` loop.

Lacking a better solution, I decided to temporarily disable this kind of
error just for this function.
* Stop release process if repo is not clean
* Update test_release_date
  Now can match versions with alphanumeric suffixes
* Give last chance to cancel upload after build
* Bump version to 1.4.4.post2
Rationale is an explantio, rational means "consistent with reason"
@waynew waynew closed this Oct 12, 2023
@waynew waynew deleted the main branch October 12, 2023 23:55
@waynew waynew restored the main branch October 12, 2023 23:56
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet