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

v3.0.0 #60

Closed
wants to merge 71 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
e03c20e
catching EOF
Feb 14, 2020
f2fb3ae
Merge pull request #58 from cs50/eof
Jelleas Mar 24, 2020
2f15212
add honesty prompt support
cmlsharp Apr 8, 2020
2d73058
fix tests
cmlsharp Apr 8, 2020
cb17879
check honesty prompt is not false first
cmlsharp Apr 8, 2020
06ad6c2
fix comment
cmlsharp Apr 8, 2020
9fe2c5a
Revert "check honesty prompt is not false first"
cmlsharp Apr 8, 2020
c5d73b8
use True to indicate default
cmlsharp Apr 29, 2020
c79c641
improve _spawn error handling
cmlsharp May 14, 2020
3573f32
check buffer and before
cmlsharp May 14, 2020
4202ea9
use ConnectionError instead of TimeoutError
cmlsharp May 14, 2020
05d6181
reraise ConnectionError
cmlsharp May 14, 2020
5f476cb
Merge pull request #59 from cs50/honesty
cmlsharp May 15, 2020
f60b436
initial docs
Jelleas Jun 1, 2020
5601a3c
local() docs
Jelleas Jun 1, 2020
f1c1942
working_area docs
Jelleas Jun 1, 2020
44d5a2a
cd & files docs
Jelleas Jun 1, 2020
1b4ffde
identify => mark
Jelleas Jun 1, 2020
473f0cb
connect() docs
Jelleas Jun 1, 2020
9e3f583
add lib50 import to ensure that examples can be copy-pasted
Jelleas Jun 1, 2020
a903e33
connect, prepare, upload docs
Jelleas Jun 2, 2020
58efb90
fetch_config + get_local_slugs docs
Jelleas Jun 2, 2020
b278d6c
Errors and ProgressBar docs
Jelleas Jun 2, 2020
4f094cc
rm mention of Submission
Jelleas Jun 2, 2020
d7f274a
examples are good, lets do more of those
Jelleas Jun 2, 2020
bd4260d
setup autodoc for lib50.config lib50.crypto
Jelleas Jun 2, 2020
a1de2cd
lib50.config docs
Jelleas Jun 2, 2020
79cac92
lib50.crypto.verify docs
Jelleas Jun 2, 2020
9bfe0d4
crypto docs
Jelleas Jun 3, 2020
2c17d8e
writeup
Jelleas Jun 3, 2020
628acec
concepts
Jelleas Jun 3, 2020
38b55f1
setup.py
Jelleas Jun 3, 2020
3c344ea
Merge pull request #61 from cs50/docs
dmalan Jun 3, 2020
6adbd7f
insert path to project in conf.py for autodoc
Jelleas Jun 3, 2020
60b0e47
add .readthedocs.yml
Jelleas Jun 3, 2020
b8179c2
package => lib50
Jelleas Jun 3, 2020
c2e4d80
lib50 => .
Jelleas Jun 3, 2020
91a456a
docs => develop
Jelleas Jun 3, 2020
40cdfe8
docs/source/conf.py
Jelleas Jun 3, 2020
37282b2
changed to dirhtml
dmalan Jun 3, 2020
b9280fa
mimic cs50.readthedocs
Jelleas Jun 4, 2020
ca41d70
include __init__ in autodoc + list instance vars in Slug
Jelleas Jun 4, 2020
46f6e96
add --single-branch flag for git clone
rongxin-liu Jul 13, 2020
fd89934
prioritize single branch cloning
rongxin-liu Jul 16, 2020
bcccfe6
factor out git command
rongxin-liu Jul 17, 2020
6f23b4e
fetch with depth 1 for local()
rongxin-liu Jul 17, 2020
50af149
update local() docs
Jelleas Jul 17, 2020
39a6718
renamed variable, moved arg, upped version
Jul 17, 2020
db28e05
Merge pull request #63 from cs50/single-branch-clone
Jul 17, 2020
145862a
add files limit, prohibit absolute paths
cmlsharp Mar 20, 2021
da1bae3
fix tests
cmlsharp Mar 20, 2021
764988d
older version of git dont support git init -b
Jelleas Mar 22, 2021
fa50c53
file_limit description, raise limit to 10000, rephrase error
Jelleas Mar 22, 2021
b2686c6
rename file_limit glob_limit
Jelleas Mar 22, 2021
b590852
improve absolute path checking
cmlsharp Mar 22, 2021
6c6e551
missing not
cmlsharp Mar 22, 2021
abe5f09
is_relative_to is 3.9+ only
cmlsharp Mar 22, 2021
1a7f3f2
mv back to file_limit
Jelleas Mar 22, 2021
d4f516e
Merge pull request #69 from cs50/files_iterator
Jelleas Mar 22, 2021
89e8b4d
initial SSH passphrases support
Jelleas Aug 2, 2021
f4bfb94
authenticate.py -> authentication.py, fix tests
Jelleas Aug 2, 2021
541d6d0
show warning, fix hanging https, reprompt for ssh
Jelleas Aug 5, 2021
9e768ee
rm undefined and unused variable
Jelleas Aug 5, 2021
0531d30
formatting
Jelleas Aug 5, 2021
fb74d79
only show GitHub password warning on normal exceptions
Jelleas Aug 6, 2021
e4a22c2
warnings for passphrase re-prompt
Jelleas Aug 6, 2021
15a3a82
through -> with
Jelleas Aug 6, 2021
6037838
preemptive warning
Jelleas Aug 6, 2021
2bea4e4
https auth phrasing + api.logger.warning => print
Jelleas Aug 7, 2021
baf2494
Merge pull request #70 from cs50/passphrase
Jelleas Aug 7, 2021
028dc6b
merge main
Jelleas Aug 7, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.DS_store

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down
15 changes: 15 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
build:
image: latest

python:
version: 3.7
install:
- method: pip
path: .
extra_requirements:
- develop

sphinx:
builder: dirhtml

version: 2
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = lib50
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
25 changes: 25 additions & 0 deletions docs/source/api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. _api:

API docs
========

.. _lib50:

lib50
*******

.. automodule:: lib50
:members:
:imported-members:

lib50.config
************

.. automodule:: lib50.config
:members:

lib50.crypto
************

.. automodule:: lib50.crypto
:members:
32 changes: 32 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import os
import sys
import time

_tool = "lib50"

# Add path to module for autodoc
sys.path.insert(0, os.path.abspath(f'../../{_tool}'))

# Include __init__ in autodoc
# Source: https://stackoverflow.com/questions/5599254/how-to-use-sphinxs-autodoc-to-document-a-classs-init-self-method
def skip(app, what, name, obj, would_skip, options):
if name == "__init__":
return False
return would_skip

def setup(app):
app.connect("autodoc-skip-member", skip)

extensions = ['sphinx.ext.autodoc']

html_css_files = ["https://cs50.readthedocs.io/_static/custom.css?" + str(round(time.time()))]
html_js_files = ["https://cs50.readthedocs.io/_static/custom.js?" + str(round(time.time()))]
html_theme = "sphinx_rtd_theme"
html_theme_options = {
"display_version": False,
"prev_next_buttons_location": False,
"sticky_navigation": False
}
html_title = f'{_tool} Docs'

project = f'{_tool}'
64 changes: 64 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
``lib50``
===========

.. toctree::
:hidden:
:maxdepth: 3
:caption: Contents:

api

.. Indices and tables
.. ==================

.. * :ref:`genindex`
.. * :ref:`api`
.. * :ref:`modindex`
.. * :ref:`search`


lib50 is CS50's library for common functionality shared between its tools. The library is, like most of CS50's projects, open-source, but its intention is to serve as an internal library for CS50's own tools. As such it is our current recommendation to not use lib50 as a dependency of one's own projects.

The following concepts live primarily in lib50:

* CS50 slugs
* git
* GitHub
* ``.cs50.yml`` config files
* signing and verification of payloads


Design
******

To promote reuse of functionality across CS50 tools, lib50 is designed to be tool agnostic. lib50 provides just the core functionality, but the semantics of that functionality are left up to the tool. For instance, submit50 adds the notion of a submission to a push, whereas it is the ``lib50.push`` function that ultimately handles the workflow with git and GitHub. Or per another example, lib50 provides the functionality to parse and validate ``.cs50.yml`` configuration files, but each individual tool (check50, submit50 and lab50) specifies their own options and handles their own logic.

With the overarching design goal to make it easy to add to or to change implementation choices, lib50 abstracts away from implementation details for other CS50 tools. Concepts such as slugs, git, GitHub, and ``.cs50.yml`` live only in lib50. Tools such as check50 interact only with lib50's API at a higher level of abstraction, such as ``lib50.push`` and ``lib50.config.Loader``. The idea being, that there is now a single point of change. For instance, one could add support for another host, such as GitLab perhaps, to ``lib50.push`` and all of CS50's tools could instantly make use of the new host.


Installation
************

First make sure you have Python 3.6 or higher installed. You can download Python |download_python|.

.. |download_python| raw:: html

<a href="https://www.python.org/downloads/" target="_blank">here</a>

lib50 has a dependency on git, please make sure to |install_git| if git is not already installed.

.. |install_git| raw:: html

<a href="https://git-scm.com/book/en/v2/Getting-Started-Installing-Git" target="_blank">install git</a>

To install lib50 under Linux / OS X:

.. code-block:: bash

pip install lib50

Under Windows, please |install_windows_sub|. Then install lib50 within the subsystem.

.. |install_windows_sub| raw:: html

<a href="https://docs.microsoft.com/en-us/windows/wsl/install-win10" target="_blank">install the Linux subsystem</a>
Loading