Skip to content

Make true CPython subset #28

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 26 commits into from
Jun 3, 2022
Merged

Conversation

tekktrik
Copy link
Member

@tekktrik tekktrik commented May 22, 2022

Resolves #27 by:

  • Make functions not available in CPython private, and override pylint errors for such functions as they really shouldn't be used in user code.
  • Now only Logger is the only logger, other loggers have been converted into Handler or subclasses of it.
  • The now PrintHandler has been changed to StreamHandler, with the default stream argument to sys.stderr
  • Logger can now take a name that gets added to the corresponding global variable
  • getLogger() now returns None if the requested logger isn't found, as opposed to creating one
  • Methods have had argument names changed to match CPython names
  • Part of one of the others, but worth saying - PrintLogger is now PrintHandler and should be used like a handler to Logger
  • Logger now has no handler as a default
  • hasHandlers() has been added to help offset the previous change
  • FileHandler was moved, and is imported from the main file (e.g. from adafruit_logging import FileHandler)
  • FileHandler is now a subclass of StreamHandler

Additionally:

  • The module has been flattened to a single file
  • setup.py has been modified accordingly
  • Examples updated to account for changes, particularly change of some previous loggers to handlers

@tekktrik tekktrik marked this pull request as draft May 22, 2022 02:05
@tekktrik tekktrik requested a review from a team May 22, 2022 02:57
@tekktrik tekktrik marked this pull request as ready for review May 22, 2022 02:57
@tekktrik
Copy link
Member Author

tekktrik commented May 22, 2022

Tested both examples successfully on Adafruit CircuitPython 7.1.1 on 2022-01-14; Adafruit PyGamer with samd51j19 with SD card!

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

A few questions about some of the changes but mostly looking good to me. I'll do some testing today as well.

@tekktrik
Copy link
Member Author

Sweet! Changes made!

@tekktrik
Copy link
Member Author

tekktrik commented Jun 3, 2022

Hey! Let me know if this is good to go, and whether we want to line up changes to places where this is a dependency (@ladyada) before merging.

@ladyada
Copy link
Member

ladyada commented Jun 3, 2022

@BlitzCityDIY this Drop In Worked just fine yeah?

@BlitzCityDIY
Copy link

@ladyada yesss running as we speak on the azure project

@ladyada
Copy link
Member

ladyada commented Jun 3, 2022

@tekktrik i think this is good to release with a maj vers bump and we'll See What Breaks :)

@tekktrik
Copy link
Member Author

tekktrik commented Jun 3, 2022

🥳

@tekktrik tekktrik merged commit 255dfff into adafruit:main Jun 3, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 4, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_Debouncer to 2.0.1 from 2.0.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_Debouncer#39 from awordforthat/add-typing
  > Set language to "en" for documentation
  > Switch to inclusive terminology
  > Increase min lines similarity
  > Patch .pre-commit-config.yaml
  > change discord badge
  > Patch: Replaced discord badge image
  > Updated gitignore
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Logging to 4.0.0 from 3.7.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_Logging#28 from tekktrik/dev/cpython-subset
  > Set language to "en" for documentation
  > Switch to inclusive terminology
  > Increase min lines similarity
  > Patch .pre-commit-config.yaml
@tekktrik tekktrik deleted the dev/cpython-subset branch January 23, 2024 05:47
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.

Make true CPython subset?
4 participants