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

Release 1.0.5 -> main #227

Merged
merged 23 commits into from
Nov 10, 2023
Merged

Release 1.0.5 -> main #227

merged 23 commits into from
Nov 10, 2023

Conversation

iambroadband
Copy link
Contributor

@iambroadband iambroadband commented Nov 10, 2023

Release 1.0.5

fjork3 and others added 21 commits September 29, 2023 17:50
Co-authored-by: Jacob Ginsparg <jacobginsparg@gmail.com>
Co-authored-by: broadband <iambroadband@gmail.com>
Update the behavior of the ScoozeApi in the following ways:
- CardApi is now a collection of async function wrappers around database operations related to cards
- ScoozeApi now uses the asyncio.Runner ContextManager to run each of the CardApi endpoints

This will prevent problems with "Event Loop is Closed" when calling asyncio.run too many times too quickly. Instead we will now rely on asyncio.Runner.run
We messed up during deploy, so I'm tacking this on after the fact. It'll
get cleaned up in the next release.
col_type can potentially be confused for columns rather than collections.
semver on 0.x.x version numbers treats minor updates equivalently to a
bump to 1.x.x; our requirement of fastapi at least 0.100.1 was not
compatible with the current newest version of 0.103.2. This PR changes
that bound to allow newest; we may need to revisit again for other
packages or when other 0.x dependencies update versions.
Co-authored-by: Jacob Ginsparg <jacobginsparg@gmail.com>
Co-authored-by: broadband <iambroadband@gmail.com>
- None as valid return type on normalizers
- typo/docstring cleanup
- clean unused imports
- missing `await` on async call
- improper runner call in API init
Turns out Python doesn't create a new instance of a default mutable
argument each time you run `__init__` instead it will create the
resource once and then reuse it over and over. We found this bug while
working on the words_per_card dogfooding. It was causing all the decks
we read in from the file to contain every card from all decks. Oops!

This should fix it cleanly. I tested this in the average_words project.
Works fine. I've also added a test here to make sure it works.
To test: 

- pip install scooze
- install docker desktop and make sure it's running
- run `scooze setup docker` to pull and initailize a docker-based mongo
instance
- populate that DB as normal with `scooze load-cards oracle`

Limitations: 
- Needs docker installed and running
- Needs port 27017 to be free on the host machine

---------

Co-authored-by: Ben Horkley <ben.horkley@gmail.com>
Co-authored-by: Jacob Ginsparg <jacobginsparg@gmail.com>
Co-authored-by: broadband <iambroadband@gmail.com>
Co-authored-by: Clayton Mentzer
Reworked the CLI to use Cleo, similar to how Poetry has theirs set up.
- Document possible exceptions in docstrings (#208)
- grammar/typos
- docstring updates
- fix type hinting for type[Generic]
- unused imports
)

Fixes #194 

There are a few extra things here that address some problems I found
when trying to use `ScoozeApi.get_card_by()` with list arguments.
`@cache` requires hashable arguments.
Co-authored-by: broadband <iambroadband@gmail.com>
@iambroadband iambroadband changed the title Release 1.0.5 Release 1.0.5 -> main Nov 10, 2023
@iambroadband iambroadband merged commit fac4359 into main Nov 10, 2023
3 checks passed
@iambroadband iambroadband deleted the release-1.0.5 branch November 10, 2023 18:52
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.

4 participants