Skip to content

Commit

Permalink
Experiment+test requests cache with GitHub api/etags (#13)
Browse files Browse the repository at this point in the history
Fixes #9 

PyGithub w/ requests-cache not working:
PyGithub/PyGithub#536 (comment)
  • Loading branch information
michaelwooley committed Jan 5, 2023
1 parent ba68983 commit b2ac8b7
Show file tree
Hide file tree
Showing 11 changed files with 755 additions and 15 deletions.
10 changes: 10 additions & 0 deletions README.md
@@ -0,0 +1,10 @@
# 👉 🕶️ 👈 NYA ("No, _you're_ awesome")

A graph of [awesome](https://github.com/sindresorhus/awesome) resources.

TODO #11 Add use cases + ideas + non-goals to top-level README.

<!-- _NON-GOAL:_ Replace the awesome human curation of awesome repos with some dumb, locally-optimal recommendation engine. BOR-ING (and useless). -->

<!-- Basically, awesome repos have a topic (e.g. "python", "robotics") and they link to a bunche of awesome, human-curated resources on that topic (code, blogs, videos). If these repos were characters in a play, they'd be like, "Bro, you're awesome 👉. And I'm gonna let the world know." -->

3 changes: 3 additions & 0 deletions py/.gitattributes
@@ -0,0 +1,3 @@
*.png filter=lfs diff=lfs merge=lfs -text
*.db filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
3 changes: 2 additions & 1 deletion py/.vscode/settings.json
@@ -1,5 +1,6 @@
{
"python.testing.pytestArgs": ["tests"],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"githubIssues.issueBranchTitle": "${user}/${sanitizedIssueTitle}/${issueNumber}"
}
1 change: 1 addition & 0 deletions py/Makefile
Expand Up @@ -13,6 +13,7 @@ install-dev: install ## Developer-specific installation
@mkdir -p data/raw
@mkdir -p data/int
@mkdir -p data/fin
@[ -f .env ] && echo "🔒🌲 .env files already exists." || (touch .env && echo "🔒🌲 Created .env file. See docs on populating it.")
@echo "🏁 Dev installed"

.PHONY: check
Expand Down
7 changes: 6 additions & 1 deletion py/README.md
Expand Up @@ -26,10 +26,16 @@ No, you're awesome. (Python side.)

# Development

See the [development docs](./docs/dev).


TODO #10 Python parts as monorepo with [namespaced package](https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#using-find-namespace-or-find-namespace-packages)?

## Setup

Pre-reqs:

- `git`
- `make`
- `pyenv`
- `python>=3.10`
Expand All @@ -49,7 +55,6 @@ make install-dev
make
```


## [ignore] Getting started with your project

First, create a repository on GitHub with the same name as this project, and then run the following commands:
Expand Down
92 changes: 92 additions & 0 deletions py/docs/dev/dev-setup.md
Expand Up @@ -4,3 +4,95 @@ See [README section](https://github.com/michaelwooley/nya/tree/main/py#setup).

TODO #3 Add dev setup.

# Initial setup

Pre-reqs:

- `make`
- `pyenv`
- `python>=3.10`
- `poetry>=1.3.0`

```bash
# Clone repo
git clone git@github.com:michaelwooley/nya.git

# Go to python part
cd nya/py

# install for local development (Wraps `make install`)
make install-dev

# View all make commands
make
```

# Secrets

TODO Add secrets init script.

- _GitHub._ Need a personal access token. ([Tutorial: 'Creating a personal access token'](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)) No special scope necessary. Both "classic" and "fine-grained" tokens work fine here.


```
GITHUB_PERSONAL_ACCESS_TOKEN=...
```


<figure markdown>
![GitHub personal access token](../static/img/github_personal_access_token.png)
<figcaption>You don't need any special scopes on the personal access token, just the token itself.</figcaption>
</figure>

# Local setups known to work

tl;dr I don't think that this should matter but here is my dev setup just in case:

- OS. manjario Linux
- Editor. VS code
- Shell. Zsh (omz)


---

**Machine:**

```
Operating System: Manjaro Linux
KDE Plasma Version: 5.26.4
KDE Frameworks Version: 5.101.0
Qt Version: 5.15.7
Kernel Version: 5.10.160-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 8 × 11th Gen Intel® Core™ i7-1165G7 @ 2.80GHz
Memory: 15.3 GiB of RAM
Graphics Processor: Mesa Intel® Xe Graphics
Manufacturer: LENOVO
Product Name: 20TD001JUS
System Version: ThinkPad E15 Gen 2
```

**Editor:**

```
Version: 1.74.2
Commit: e8a3071ea4344d9d48ef8a4df2c097372b0c5161
Date: 2022-12-20T10:27:19.253Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Linux x64 5.10.160-1-MANJARO
Sandboxed: No
```

**Python:**

```bash
❯ python --version
Python 3.10.4
❯ pyenv --version
pyenv 2.3.9
❯ poetry --version
Poetry (version 1.3.1)
```
3 changes: 3 additions & 0 deletions py/docs/static/img/github_personal_access_token.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion py/mkdocs.yml
Expand Up @@ -10,14 +10,15 @@ site_author: Michael Wooley
edit_uri: edit/main/docs/
repo_name: michaelwooley/nya
copyright: Maintained by <a href="https://github.com/michaelwooley">Michael Wooley</a>.
use_directory_urls: false

nav:
- Home: index.md
- Modules: modules.md
- Development:
- dev/index.md
- Contributing: dev/contributing.md
- Dev setup: dev/setup.md
- Dev setup: dev/dev-setup.md
- Boilerplate: dev/boilerplate.md
plugins:
- search
Expand Down Expand Up @@ -69,3 +70,4 @@ markdown_extensions:
permalink: true
- pymdownx.arithmatex:
generic: true
- md_in_html

0 comments on commit b2ac8b7

Please sign in to comment.