ENB: studying code for credit

53 views
Skip to first unread message

Edward K. Ream

unread,
Sep 22, 2024, 9:38:26 AM9/22/24
to leo-editor
This Engineering Notebook post tells how I plan to study projects like pylint and receive GitHub recognition for intermediate commits.

Aha! unfreeze modules!

Python's -X frozen_modules command-line argument bypasses all frozen modules, allowing me to step through all code. This argument makes it possible to study code in the sitecustomize folder!

Aha! Create repos in sitecustomize!

Devs get no credit for work done in cloned or forked repos until owners accept a PR. This policy is not alright with me. Copying a repo (by hand) allows me to get credit, but it's impossible to keep such repos up-to-date.

Creating a private repo in the sitecustomize folder is the solution:

- pip install pylint --upgrade keeps the code up-to-date.
- I'll get credit for all commits.

Summary

Python's -X frozen_modules command-line argument bypasses all frozen modules, allowing me to step through all code.

Converting projects in sitecustomize to personal repos allows me to get credit for my studies.

Edward

Thomas Passin

unread,
Sep 22, 2024, 10:42:53 AM9/22/24
to leo-editor
On Sunday, September 22, 2024 at 9:38:26 AM UTC-4 Edward K. Ream wrote:
This Engineering Notebook post tells how I plan to study projects like pylint and receive GitHub recognition for intermediate commits.

Aha! Create repos in sitecustomize!

Devs get no credit for work done in cloned or forked repos until owners accept a PR. This policy is not alright with me. Copying a repo (by hand) allows me to get credit, but it's impossible to keep such repos up-to-date.

Here's how I keep my cloned Leo-Editor GitHub repo up to date.   I cloned my github repo using GitHub to do it so it was created in my own GitHub repository.  Then I cloned Leo-editor from my own Github site to my computer. It got linked to the my GitHub version under the name "origin".  The official Leo-Editor repo is linked under the name "upstream".  I forget exactly how I did it, and I used the Get-Extensions program and you don't.  But I know it's not hard to do the same thing by hand with git itself.

To update , I check out my local devel branch and fetch/merge from upstream Leo-Editor.  Then I push that my origin repo. 

Creating a private repo in the sitecustomize folder is the solution:

Do you mean the sitecustomize folder on your computer? Python can also use a usercustomize folder, which seems better.  Either way, why does this scheme make any difference so far as GitHub is concerned?

I don't actually use either folder, because I would have to create a new one for each version of Python I install, and then I couldn't easily keep them all synced.  Instead, I have created a "pycustomize" folder - any name would do - and in the user's site-packages of each Python installation I point to it with a "custom.pth" file.  This file contains only this:

..\..\

This causes Python to scan the parent directory of your particular Python version, and it picks up your Python files in "pycustomize".  This works for standard Windows installs since the typical directory structure is like this:

%APPDATA%
    Python
        pycustomize  <------ my added directory
        Python3.10
        Python 3.11
        Python 3.12
            Scripts
            site-packages
                custom.pth   <------- my .pth file
                (python library packages)

So all versions of Python can access the same version of my code.

If you meant some other sitecustomize folder, then I don't understand what that is.  Please explain more.

Edward K. Ream

unread,
Sep 22, 2024, 2:30:37 PM9/22/24
to leo-e...@googlegroups.com
On Sun, Sep 22, 2024 at 9:42 AM Thomas Passin <tbp1...@gmail.com> wrote:

> Do you mean the sitecustomize folder on your computer?

Yes.

> why does this scheme make any difference so far as GitHub is concerned?

I push any changes to my own (non-cloned, non-forked) repo over which I have full control. The official pylint repo knows nothing of my repo. Since I am the owner of the repo, GitHub updates my commit stats.

Edward

Edward K. Ream

unread,
Sep 22, 2024, 2:41:08 PM9/22/24
to leo-editor
On Sunday, September 22, 2024 at 8:38:26 AM UTC-5 Edward K. Ream wrote:

Summary

Python's -X frozen_modules command-line argument bypasses all frozen modules, allowing me to step through all code.

Converting projects in sitecustomize to personal repos allows me to get credit for my studies.

Two more Ahas derive from this workflow:

Aha: Use programs, not unit tests

pylint, mypy and ruff run unit tests from bespoke (complex!) frameworks.

Instead, create a small test program and single-step through that.

Aha: Just study the distributed code

Distributions contain fewer files than repos! The results of a recursive import will be smaller.

Edward

Edward K. Ream

unread,
Sep 27, 2024, 10:05:54 AM9/27/24
to leo-editor
On Sunday, September 22, 2024 at 8:38:26 AM UTC-5 Edward K. Ream wrote:

> Devs get no credit for work done in cloned or forked repos until owners accept a PR. This policy is not alright with me.

I see now that this statement is a mistake in attitude.

I'll be studying new areas next. It's liberating not to be concerned about credit or intermediate results.

Edward
Reply all
Reply to author
Forward
0 new messages