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

add initial client skeleton #1

Merged
merged 10 commits into from
Aug 2, 2018
Merged

add initial client skeleton #1

merged 10 commits into from
Aug 2, 2018

Conversation

redshiftzero
Copy link
Contributor

made some initial choices here, pulling a PR to give people an opportunity to speak up if they don't like them 😇

  • integrates alembic autogenerated migrations support (from the beginning)
  • I chose SQLite here for simplicity (the db creation / alembic upgrade head logic should eventually go in postinst). we want this to be incredibly easy to deploy/manage and SQLite is perfect for that, even though it does mean doing some odd migration acrobatics every now and then
  • I made the simplest table from: Implementing a journalist client securedrop-workstation#88 (comment)
  • hooked up circle CI

@redshiftzero
Copy link
Contributor Author

@heartsucker you will have feelings about these choices i made, let's squabble!

Copy link
Contributor

@heartsucker heartsucker left a comment

Choose a reason for hiding this comment

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

Only preferential nits, no blockers.

command: |
virtualenv venv
source venv/bin/activate
pip3 install -r requirements/requirements-dev.txt
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: I'm more of a fan of the dev requirements being a merge of req.in and req-dev.in than having them be separate.

README.md Outdated
## Run tests

```
python -m unittest
Copy link
Contributor

Choose a reason for hiding this comment

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

y no pytest :(

Copy link
Contributor Author

Choose a reason for hiding this comment

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

mostly because I generally stick to the stdlib until I Need A Thing in a dependency, but it's a test dep and I do like fixtures so I added pytest 😛

from sqlalchemy.ext.declarative import declarative_base


DB_PATH = 'svs.sqlite'
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: It would be nice to see a huge TODO over this to remind us to factor this out into a config for later.

Less of a nit: this should be path.abspath('svs.sqlite')

sqlite3.connect(DB_PATH)
subprocess.check_output('alembic upgrade head'.split())

engine = create_engine('sqlite:///{}'.format(DB_PATH))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this needs to have one more / because DB_PATH isn't absolute. Unless sqlite does relative paths when the URI doesn't start with //?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(DB_PATH now absolute in 6dd6fa6)

@redshiftzero
Copy link
Contributor Author

hey @kushaldas, let me know if you have any thoughts/suggestions on this diff, else we can merge and proceed

Copy link
Contributor

@kushaldas kushaldas left a comment

Choose a reason for hiding this comment

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

This looks okay in my mind. But, as we are starting this fresh, can we please pipenv to control the dependencies?

@redshiftzero
Copy link
Contributor Author

fair, done!

@legoktm legoktm mentioned this pull request Sep 29, 2022
3 tasks
legoktm pushed a commit that referenced this pull request Dec 11, 2023
Adds modular version of Qubes Workstation send-to-usb script
legoktm pushed a commit that referenced this pull request Dec 11, 2023
synchronize singleton creation using threading.Lock() in __call__
legoktm pushed a commit that referenced this pull request Dec 11, 2023
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.

3 participants