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

Adding new example for circuitpython requests_https #68

Merged
merged 5 commits into from
Feb 9, 2021
Merged

Adding new example for circuitpython requests_https #68

merged 5 commits into from
Feb 9, 2021

Conversation

jfabernathy
Copy link
Contributor

I've been asked to add my example to the directory of example. It's uses requests_https on circuitpython and has been tested on an Adafruit Metro ESP32 Express

@ladyada
Copy link
Member

ladyada commented Feb 1, 2021

hihi looks like needs a copyright notice at the top, maybe black and pylint - do ya know how to do those?

@jfabernathy
Copy link
Contributor Author

Sorry not sure what they are or how to fix it now that the code on my end has been committed and pushed. It was amazing that I got that for. I'm guessing that you have a generic copyright that can be inserted. What happen is someone pointed me to an example that wouldn't work and I fixed it. I uploaded that to the forum for anyone interested. Someone asked me to put it on github. Turned out that the example was really for python on a raspberry pi using the blinka library. So here we are. The is where I was told to post the example this time. I was able to fork, clone, add the file commit and push. That's about all this 70 year old can do.

@ladyada
Copy link
Member

ladyada commented Feb 2, 2021

ha ok @dherrada can help you out with the rest, you're really close!

@ladyada ladyada requested a review from evaherrada February 2, 2021 01:10
@evaherrada
Copy link
Collaborator

evaherrada commented Feb 2, 2021

@jfabernathy Ok, so it looks like you're currently failing two of the pre-commit checks.

The first one is the black check. This one is pretty easy to fix. Basically install black with pip install black and then run it in your directory with black --target-version=py35 . .

Now, you also added a file, so you're gonna need to add a license to it. I'd just copy the text from the other example files and change the name to your name and possibly the year if it isn't 2021.

Let me know if you're having any issues getting that to work and I can try to help troubleshoot.

@jfabernathy
Copy link
Contributor Author

I ran the black program and it reformated but there are no licenses in any of the examples in this directory. There is a MIT license file in the parent directory. Not sure what to do about that

@evaherrada
Copy link
Collaborator

@jfabernathy This is the license for examples. Since you're adding a new one that you wrote, replace ladyada with your name (can be either your GitHub name or your actual name). Looks like your fork was made before I added them to this library which makes sense as to why you didn't see them.

# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT

@jfabernathy
Copy link
Contributor Author

after I added the License statements I committed and pushed. It failed again and I finally found out why. pylint really doesn't like my import statements and I have no idea why. The code runs fine.

@anecdata
Copy link
Member

anecdata commented Feb 3, 2021

@jfabernathy the details of what pylint is failing is here: https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/68/checks?check_run_id=1826084237 It's not necessarily "right", but you can re-sequence the imports as it suggests and see if that makes it happy.

If that link doesn't work, click on the "Details" below to the right of "Build CI / test (pull_request) Failing after 1m — test".

@jfabernathy
Copy link
Contributor Author

I've made progress but still failing with one error, exit code 1. So not sure what to do. imports seem fine now.

@anecdata
Copy link
Member

anecdata commented Feb 3, 2021

I'm not sure about that one, maybe dherrada can advise.

@askpatrickw
Copy link
Contributor

If pre-commit finds anything it will exit that way.
https://github.com/adafruit/Adafruit_CircuitPython_Requests/pull/68/checks?check_run_id=1826367683#step:11:24
At that line, you can see that black wanted to reformat a file.
One more run of black locally and then commit that file.

Whew... I know. ;-) But you got this !

@jfabernathy
Copy link
Contributor Author

I ran black again, added, committed, and pushed again. It didn't reject this time. Only good news about this process is it will drive you to drink :-)

@evaherrada
Copy link
Collaborator

@jfabernathy Great to see that it's passing!

@evaherrada evaherrada requested a review from a team February 4, 2021 19:08
Copy link
Member

@anecdata anecdata left a comment

Choose a reason for hiding this comment

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

Tested successfully on FeatherS2. Thanks for sticking with it @jfabernathy!

@evaherrada
Copy link
Collaborator

Merging since we've got 2 approvals

@evaherrada evaherrada merged commit 46a3a47 into adafruit:master Feb 9, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Feb 12, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_BME680 to 3.3.1 from 3.3.0:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_BME680#40 from caternuson/iss39
  > Merge pull request adafruit/Adafruit_CircuitPython_BME680#36 from adafruit/REUSE
  > Merge pull request adafruit/Adafruit_CircuitPython_BME680#38 from caternuson/iss37_spi_example
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_CLUE to 2.2.7 from 2.2.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_CLUE#37 from adafruit/REUSE
  > Hardcoded Black and REUSE versions
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_FONA to 2.1.2 from 2.1.1:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_FONA#12 from adafruit/REUSE
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_HTS221 to 1.1.3 from 1.1.2:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_HTS221#6 from adafruit/REUSE
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_MSA301 to 1.2.5 from 1.2.4:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_MSA301#14 from adafruit/REUSE
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_NeoPixel to 6.0.2 from 6.0.1:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_NeoPixel#103 from adafruit/REUSE
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_RockBlock to 1.3.1 from 1.3.0:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_RockBlock#19 from adafruit/REUSE

Updating https://github.com/adafruit/Adafruit_CircuitPython_SCD30 to 2.0.2 from 2.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_SCD30#9 from caternuson/iss2_mcp2221

Updating https://github.com/adafruit/Adafruit_CircuitPython_SSD1327 to 1.2.1 from 1.2.0:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_SSD1327#9 from adafruit/REUSE
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_ST7789 to 1.4.3 from 1.4.2:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_ST7789#21 from wildestpixel/patch-1

Updating https://github.com/adafruit/Adafruit_CircuitPython_TCA9548A to 0.3.4 from 0.3.3:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_TCA9548A#23 from SAK917/adafruit/Adafruit_CircuitPython_TCA9548A#20-remove-obsolete-code

Updating https://github.com/adafruit/Adafruit_CircuitPython_AWS_IOT to 2.0.5 from 2.0.4:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_AWS_IOT#16 from adafruit/REUSE
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_AzureIoT to 2.3.3 from 2.3.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_AzureIoT#25 from adafruit/REUSE
  > Hardcoded Black and REUSE versions
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bitmap_Font to 1.3.4 from 1.3.3:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_Bitmap_Font#37 from jfurcean/fix_api_docs

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_MIDI to 1.0.3 from 1.0.2:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_MIDI#6 from adafruit/REUSE

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Text to 1.12.3 from 2.12.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#117 from kmatch98/bitmap_label_scale
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Text#116 from lesamouraipourpre/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_Hue to 1.1.3 from 1.1.2:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_Hue#14 from adafruit/REUSE

Updating https://github.com/adafruit/Adafruit_CircuitPython_ImageLoad to 0.13.2 from 0.13.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_ImageLoad#43 from adafruit/REUSE
  > Hardcoded Black and REUSE versions
  > Added pre-commit-config file

Updating https://github.com/adafruit/Adafruit_CircuitPython_LIFX to 1.9.4 from 1.1.2:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_LIFX#10 from adafruit/REUSE

Updating https://github.com/adafruit/Adafruit_CircuitPython_MagTag to 1.6.0 from 1.5.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_MagTag#54 from makermelissa/main

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.9.6 from 1.9.5:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#68 from jfabernathy/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_SimpleIO to 3.0.1 from 3.0.0:
  > Hardcoded Black and REUSE versions
  > Merge pull request adafruit/Adafruit_CircuitPython_SimpleIO#60 from adafruit/REUSE
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.

6 participants