Skip to content

Bot.py: default _on_event_callback takes one argument#22

Merged
double-fault merged 1 commit intoSOBotics:masterfrom
tripleee:on-event-fix
Apr 25, 2019
Merged

Bot.py: default _on_event_callback takes one argument#22
double-fault merged 1 commit intoSOBotics:masterfrom
tripleee:on-event-fix

Conversation

@tripleee
Copy link
Copy Markdown
Collaborator

I was getting warnings from PulseMonitor for the latest release when I wasn't using the callback myself. I hope adding an argument to the default lambda is a correct fix. (I suppose the code could also look for the callback to be not None at callback time and use a simpler default.)

@tripleee tripleee changed the title Bot.py: defsult _on_event_callback takes one argument Bot.py: default _on_event_callback takes one argument Apr 25, 2019
@tripleee
Copy link
Copy Markdown
Collaborator Author

I went through royal pains to get this into testing in the current Docker build of Pulse Monitor for testing, so I can at least attest to that it doesn't break there. The warning I was getting in the logs was pretty harmless I suppose, but arguably the code should run without such annoyances out of the box.

@double-fault
Copy link
Copy Markdown
Member

Yeah, that looks good to me; I must have somehow missed it. Thanks!

Would it be possible for you to make a PyPi release, or do you want me to do it?

@double-fault double-fault merged commit fad3bdf into SOBotics:master Apr 25, 2019
@tripleee
Copy link
Copy Markdown
Collaborator Author

I'll be happy to attempt a PyPi release tomorrow. I'll be available roughly 0730 UTC until approx 12, is there a particular time in that timeframe you could be online for consultation and coordination?

@double-fault
Copy link
Copy Markdown
Member

@tripleee Sure! I'll try to pop in to the Charcoal Test room at around 0830 UTC, but I can't promise that. Do ping me though if you face any problems.

TBH, I don't really remember the exact process of doing an upload the first time, since I just use an alias for it nowadays. The technique I use seems to be using a legacy API, so if you can figure out a better way, go for it!

Here's what I could understand from files on my computer, and this should work for you.

  • Create a file named .pypirc in your home directory, with a format like:
[distutils]
index-servers = 
	pypi

[pypi]
repository=https://pypi.python.org/pypi
username=tripleee
password=SomeRandomPassword
  • Go to the Botpy directory and edit setup.py to reflect the new version number.
  • Edit the Readme Changelog, and probably push to GH, along with a new tag on GH.
  • Upload to PyPi using the command: python3 setup.py sdist upload

That's it! It should probably work, but be warned the technique uses a Legacy API (or so I am warned). I'm too lazy to change it since it works, but if it troubles you, don't use it.

@tripleee tripleee deleted the on-event-fix branch April 26, 2019 04:13
@tripleee
Copy link
Copy Markdown
Collaborator Author

Publish done, for the record.

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.

2 participants