Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jsarchibald/python-cs50
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: sql_transactions
Choose a base ref
...
head repository: cs50/python-cs50
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref

Commits on Dec 15, 2019

  1. Merge pull request cs50#106 from cs50/develop

    v5.0.0
    dmalan authored Dec 15, 2019
    Copy the full SHA
    9183228 View commit details

Commits on Jan 11, 2020

  1. Merge pull request cs50#108 from cs50/develop

    Removed removal of PWD
    dmalan authored Jan 11, 2020
    Copy the full SHA
    d1e5ff7 View commit details

Commits on Jan 13, 2020

  1. Merge pull request cs50#109 from cs50/develop

    disconnecting only if there's a connection
    Kareem Zidane authored Jan 13, 2020
    Copy the full SHA
    1689322 View commit details

Commits on Feb 3, 2020

  1. Merge pull request cs50#113 from cs50/develop

    cte
    Kareem Zidane authored Feb 3, 2020
    Copy the full SHA
    ad5cbc5 View commit details

Commits on May 4, 2020

  1. Merge pull request cs50#119 from cs50/develop

    Handles OverflowError from get_float
    dmalan authored May 4, 2020
    Copy the full SHA
    3cb3ff0 View commit details

Commits on Jun 12, 2020

  1. Merge pull request cs50#122 from jsarchibald/sql_transactions

    Transaction sessions; appcontext teardown fix; multiple databases in request fix.
    dmalan authored Jun 12, 2020
    Copy the full SHA
    5e30c80 View commit details
  2. style tweaks

    dmalan authored Jun 12, 2020
    Copy the full SHA
    c51a9df View commit details
  3. version++

    Mostly bug fixes, but arguably adds support for multiple connections too
    dmalan authored Jun 12, 2020
    Copy the full SHA
    4924fa1 View commit details

Commits on Aug 19, 2020

  1. Merge pull request cs50#124 from cs50/develop

    Re-implements SQL support with sessions
    Kareem Zidane authored Aug 19, 2020
    Copy the full SHA
    2d40229 View commit details

Commits on Aug 28, 2020

  1. Update README.md

    Remove non-Pythonic semicolons.
    cbscribe authored Aug 28, 2020
    Copy the full SHA
    74c74cc View commit details
  2. Merge pull request cs50#129 from cbscribe/patch-1

    Update README.md
    dmalan authored Aug 28, 2020
    Copy the full SHA
    41166b3 View commit details

Commits on Nov 22, 2020

  1. added tests for IN

    dmalan committed Nov 22, 2020
    Copy the full SHA
    e7c0df8 View commit details
  2. reverting to 5.0.5

    dmalan committed Nov 22, 2020
    Copy the full SHA
    cf34af7 View commit details
  3. adds tests for IN

    dmalan committed Nov 22, 2020
    Copy the full SHA
    2be1e24 View commit details
  4. updated .travis.yml

    dmalan committed Nov 22, 2020
    Copy the full SHA
    a598334 View commit details
  5. working on transactions

    dmalan committed Nov 22, 2020
    Copy the full SHA
    b2fc969 View commit details
  6. fixed support for transactions

    dmalan committed Nov 22, 2020
    Copy the full SHA
    9d007a4 View commit details
  7. updated README

    dmalan committed Nov 22, 2020
    Copy the full SHA
    f44c562 View commit details
  8. added sample tests

    dmalan committed Nov 22, 2020
    Copy the full SHA
    87dd161 View commit details
  9. tidied code

    dmalan committed Nov 22, 2020
    Copy the full SHA
    a14e549 View commit details

Commits on Nov 23, 2020

  1. fixed README

    dmalan committed Nov 23, 2020
    Copy the full SHA
    c68324d View commit details
  2. corrected syntax in README

    dmalan committed Nov 23, 2020
    Copy the full SHA
    083bf5e View commit details
  3. Copy the full SHA
    a11c9b9 View commit details
  4. Copy the full SHA
    727df50 View commit details
  5. Copy the full SHA
    31305e1 View commit details
  6. updated tests for ValueError

    dmalan committed Nov 23, 2020
    Copy the full SHA
    e8cca8d View commit details
  7. updated test for ValueError

    dmalan committed Nov 23, 2020
    Copy the full SHA
    16e52bf View commit details
  8. Merge pull request cs50#133 from cs50/transactions

    Fixes support for transactions for SQLite, PostgreSQL, and MySQL
    dmalan authored Nov 23, 2020
    Copy the full SHA
    e9464d8 View commit details
  9. Copy the full SHA
    5857d3f View commit details
  10. version++

    dmalan committed Nov 23, 2020
    Copy the full SHA
    0a63c89 View commit details
  11. Merge pull request cs50#134 from cs50/unpacking

    removed support for unpacking dicts and lists in execute
    dmalan authored Nov 23, 2020
    Copy the full SHA
    b9b196d View commit details
  12. removed TEMPLATES_AUTO_RELOAD

    dmalan committed Nov 23, 2020
    Copy the full SHA
    ead20a7 View commit details

Commits on Nov 24, 2020

  1. fix typo

    Kareem Zidane committed Nov 24, 2020
    Copy the full SHA
    87394fd View commit details

Commits on Nov 25, 2020

  1. configure root logger

    Kareem Zidane committed Nov 25, 2020
    Copy the full SHA
    a80dfeb View commit details
  2. handle no root logger handlers

    Kareem Zidane committed Nov 25, 2020
    Copy the full SHA
    f3750c7 View commit details
  3. use separate logger for cs50.sql

    Kareem Zidane committed Nov 25, 2020
    Copy the full SHA
    db0d14a View commit details
  4. move logger to module level

    Kareem Zidane committed Nov 25, 2020
    Copy the full SHA
    aea0dfe View commit details
  5. s/ch/handler/

    Kareem Zidane committed Nov 25, 2020
    Copy the full SHA
    74f03f0 View commit details
  6. rename logger to cs50

    Kareem Zidane committed Nov 25, 2020
    Copy the full SHA
    9cd038c View commit details
  7. configure cs50 logger in cs50 module

    Kareem Zidane committed Nov 25, 2020
    Copy the full SHA
    f2ba330 View commit details
  8. forcibly enable cs50 logger in flask apps

    Kareem Zidane committed Nov 25, 2020
    Copy the full SHA
    7dd19ad View commit details

Commits on Nov 26, 2020

  1. Merge pull request cs50#136 from cs50/logger

    configure root logger
    Kareem Zidane authored Nov 26, 2020
    Copy the full SHA
    4887b5f View commit details
  2. Merge pull request cs50#135 from cs50/develop

    Fixes support for transactions, drops support for unpacking of args to execute
    Kareem Zidane authored Nov 26, 2020
    Copy the full SHA
    a3b3cc5 View commit details

Commits on Nov 28, 2020

  1. Update README.md

    dmalan authored Nov 28, 2020
    Copy the full SHA
    5a575e7 View commit details
  2. updated Travis [skip ci]

    dmalan committed Nov 28, 2020
    Copy the full SHA
    ddeba08 View commit details

Commits on Nov 29, 2020

  1. fixing teardown_appcontext

    dmalan committed Nov 29, 2020
    Copy the full SHA
    8e210de View commit details
  2. Copy the full SHA
    2b9e9a6 View commit details
  3. removed id(), added comments

    dmalan committed Nov 29, 2020
    Copy the full SHA
    2d5b446 View commit details
  4. version++

    dmalan committed Nov 29, 2020
    Copy the full SHA
    f50dfd7 View commit details
  5. Merge pull request cs50#138 from cs50/teardown_appcontext

    Fixes teardown_appcontext, adds support for multiple DB connections when using Flask
    dmalan authored Nov 29, 2020
    Copy the full SHA
    dfe1d93 View commit details
Showing with 1,260 additions and 411 deletions.
  1. +68 −0 .github/workflows/main.yml
  2. +2 −2 .gitignore
  3. +0 −30 .travis.yml
  4. +6 −0 Dockerfile
  5. +671 −4 LICENSE
  6. +23 −3 README.md
  7. +33 −0 docker-compose.yml
  8. +4 −2 setup.py
  9. +1 −0 src/cs50/__init__.py
  10. +64 −27 src/cs50/cs50.py
  11. +15 −8 src/cs50/flask.py
  12. +272 −162 src/cs50/sql.py
  13. +3 −57 tests/flask/application.py
  14. +0 −49 tests/flask/test.py
  15. +51 −0 tests/foo.py
  16. +47 −67 tests/sql.py
68 changes: 68 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
on: push
jobs:
deploy:
runs-on: ubuntu-latest
services:
mysql:
image: mysql
env:
MYSQL_DATABASE: test
MYSQL_ALLOW_EMPTY_PASSWORD: yes
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
ports:
- 3306:3306
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: test
ports:
- 5432:5432
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
check-latest: true
- name: Setup databases
run: |
pip install .
pip install mysqlclient psycopg2-binary SQLAlchemy
- name: Run tests
run: python tests/sql.py
env:
MYSQL_HOST: 127.0.0.1
POSTGRESQL_HOST: 127.0.0.1

- name: Install pypa/build
run: python -m pip install build --user

- name: Build a binary wheel and a source tarball
run: python -m build --sdist --wheel --outdir dist/ .

- name: Deploy to PyPI
if: ${{ github.ref == 'refs/heads/main' }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

- name: Get Version
id: py_version
run: |
echo ::set-output name=version::$(python3 setup.py --version)
- name: Create Release
if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/github-script@v7
with:
github-token: ${{ github.token }}
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: "v${{ steps.py_version.outputs.version }}",
tag_commitish: "${{ github.sha }}"
})
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.*
!/.github/
!.gitignore
!.travis.yml
dist/
build/
*.db
*.egg-info/
*.pyc
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM cs50/cli

RUN sudo apt update && sudo apt install --yes libmysqlclient-dev pgloader pkg-config postgresql
RUN sudo pip3 install mysqlclient psycopg2-binary

WORKDIR /mnt
Loading