diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml new file mode 100644 index 0000000..308fda1 --- /dev/null +++ b/.github/workflows/python.yaml @@ -0,0 +1,19 @@ +name: python + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Clone Repository + uses: actions/checkout@v4 + + - name: Spell Check + uses: rojopolis/spellcheck-github-actions@0.45.0 + with: + output_file: spellcheck-output.txt \ No newline at end of file diff --git a/.spellcheck_exceptions_dictionary.txt b/.spellcheck_exceptions_dictionary.txt new file mode 100644 index 0000000..b9580f8 --- /dev/null +++ b/.spellcheck_exceptions_dictionary.txt @@ -0,0 +1,101 @@ +# acronyms +CRLF +LF +DLR +DETENT +DEDENT +REPL +BNF +UTF + + +# authors +Rossum + + +# domain specific +radix +bytecode +whitespace +formfeeds +formfeed +encodings +codecs +namespace +pycache +IndentationError +TabError +SyntaxError +datamodel +coroutines +lexemes +lexically +NFKC +classname +dunder +bitwise +executionmodel + +# python keywords +pprint +stdtypes +builtins +str +eval +repr +elif +nonlocal +async +formatspec +sys +iterable +init + + +# technology: +JVM +pyspelling +pytest +svg +yaml +numpy +distutils +ensurepip +setuptools +venv +pipenv + + +# institutions: +pypa +pypi +hackerrank +roadmap + + +# urls: +src +txt +py +devguide +edu +modindex +img +ccec +eb +Aq +Bstatus +Pze +ocw +piNY +psf +tzYhv +https + + +# pythons implementations: +CPython +IronPython +jython +pypy +pythonnet \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 36c7591..4abeaeb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,13 @@ -FROM mcr.microsoft.com/devcontainers/python:1-3.12-bullseye +FROM python:3.11 WORKDIR /python COPY . . -RUN pipenv install \ No newline at end of file +RUN apt-get update \ + && apt-get install aspell -y + +RUN python -m pip install -r requirements.txt + +RUN adduser -u 5678 --disabled-password --gecos "" python && chown -R python /python +USER python \ No newline at end of file diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 9453076..0000000 --- a/Pipfile +++ /dev/null @@ -1,13 +0,0 @@ -[[source]] -url = "https://pypi.org/simple" -verify_ssl = true -name = "pypi" - -[packages] -black = "*" -numpy = "*" - -[dev-packages] - -[requires] -python_version = "3.12" diff --git a/Pipfile.lock b/Pipfile.lock deleted file mode 100644 index ad7d1ac..0000000 --- a/Pipfile.lock +++ /dev/null @@ -1,133 +0,0 @@ -{ - "_meta": { - "hash": { - "sha256": "e1e1c07a6595c791da93281c22ae564a6900608801b1604c955bb1919de97b16" - }, - "pipfile-spec": 6, - "requires": { - "python_version": "3.12" - }, - "sources": [ - { - "name": "pypi", - "url": "https://pypi.org/simple", - "verify_ssl": true - } - ] - }, - "default": { - "black": { - "hashes": [ - "sha256:257d724c2c9b1660f353b36c802ccece186a30accc7742c176d29c146df6e474", - "sha256:37aae07b029fa0174d39daf02748b379399b909652a806e5708199bd93899da1", - "sha256:415e686e87dbbe6f4cd5ef0fbf764af7b89f9057b97c908742b6008cc554b9c0", - "sha256:48a85f2cb5e6799a9ef05347b476cce6c182d6c71ee36925a6c194d074336ef8", - "sha256:7768a0dbf16a39aa5e9a3ded568bb545c8c2727396d063bbaf847df05b08cd96", - "sha256:7e122b1c4fb252fd85df3ca93578732b4749d9be076593076ef4d07a0233c3e1", - "sha256:88c57dc656038f1ab9f92b3eb5335ee9b021412feaa46330d5eba4e51fe49b04", - "sha256:8e537d281831ad0e71007dcdcbe50a71470b978c453fa41ce77186bbe0ed6021", - "sha256:98e123f1d5cfd42f886624d84464f7756f60ff6eab89ae845210631714f6db94", - "sha256:accf49e151c8ed2c0cdc528691838afd217c50412534e876a19270fea1e28e2d", - "sha256:b1530ae42e9d6d5b670a34db49a94115a64596bc77710b1d05e9801e62ca0a7c", - "sha256:b9176b9832e84308818a99a561e90aa479e73c523b3f77afd07913380ae2eab7", - "sha256:bdde6f877a18f24844e381d45e9947a49e97933573ac9d4345399be37621e26c", - "sha256:be8bef99eb46d5021bf053114442914baeb3649a89dc5f3a555c88737e5e98fc", - "sha256:bf10f7310db693bb62692609b397e8d67257c55f949abde4c67f9cc574492cc7", - "sha256:c872b53057f000085da66a19c55d68f6f8ddcac2642392ad3a355878406fbd4d", - "sha256:d36ed1124bb81b32f8614555b34cc4259c3fbc7eec17870e8ff8ded335b58d8c", - "sha256:da33a1a5e49c4122ccdfd56cd021ff1ebc4a1ec4e2d01594fef9b6f267a9e741", - "sha256:dd1b5a14e417189db4c7b64a6540f31730713d173f0b63e55fabd52d61d8fdce", - "sha256:e151054aa00bad1f4e1f04919542885f89f5f7d086b8a59e5000e6c616896ffb", - "sha256:eaea3008c281f1038edb473c1aa8ed8143a5535ff18f978a318f10302b254063", - "sha256:ef703f83fc32e131e9bcc0a5094cfe85599e7109f896fe8bc96cc402f3eb4b6e" - ], - "index": "pypi", - "markers": "python_version >= '3.8'", - "version": "==24.4.2" - }, - "click": { - "hashes": [ - "sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28", - "sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de" - ], - "markers": "python_version >= '3.7'", - "version": "==8.1.7" - }, - "mypy-extensions": { - "hashes": [ - "sha256:4392f6c0eb8a5668a69e23d168ffa70f0be9ccfd32b5cc2d26a34ae5b844552d", - "sha256:75dbf8955dc00442a438fc4d0666508a9a97b6bd41aa2f0ffe9d2f2725af0782" - ], - "markers": "python_version >= '3.5'", - "version": "==1.0.0" - }, - "numpy": { - "hashes": [ - "sha256:03a8c78d01d9781b28a6989f6fa1bb2c4f2d51201cf99d3dd875df6fbd96b23b", - "sha256:08beddf13648eb95f8d867350f6a018a4be2e5ad54c8d8caed89ebca558b2818", - "sha256:1af303d6b2210eb850fcf03064d364652b7120803a0b872f5211f5234b399f20", - "sha256:1dda2e7b4ec9dd512f84935c5f126c8bd8b9f2fc001e9f54af255e8c5f16b0e0", - "sha256:2a02aba9ed12e4ac4eb3ea9421c420301a0c6460d9830d74a9df87efa4912010", - "sha256:2e4ee3380d6de9c9ec04745830fd9e2eccb3e6cf790d39d7b98ffd19b0dd754a", - "sha256:3373d5d70a5fe74a2c1bb6d2cfd9609ecf686d47a2d7b1d37a8f3b6bf6003aea", - "sha256:47711010ad8555514b434df65f7d7b076bb8261df1ca9bb78f53d3b2db02e95c", - "sha256:4c66707fabe114439db9068ee468c26bbdf909cac0fb58686a42a24de1760c71", - "sha256:50193e430acfc1346175fcbdaa28ffec49947a06918b7b92130744e81e640110", - "sha256:52b8b60467cd7dd1e9ed082188b4e6bb35aa5cdd01777621a1658910745b90be", - "sha256:60dedbb91afcbfdc9bc0b1f3f402804070deed7392c23eb7a7f07fa857868e8a", - "sha256:62b8e4b1e28009ef2846b4c7852046736bab361f7aeadeb6a5b89ebec3c7055a", - "sha256:666dbfb6ec68962c033a450943ded891bed2d54e6755e35e5835d63f4f6931d5", - "sha256:675d61ffbfa78604709862923189bad94014bef562cc35cf61d3a07bba02a7ed", - "sha256:679b0076f67ecc0138fd2ede3a8fd196dddc2ad3254069bcb9faf9a79b1cebcd", - "sha256:7349ab0fa0c429c82442a27a9673fc802ffdb7c7775fad780226cb234965e53c", - "sha256:7ab55401287bfec946ced39700c053796e7cc0e3acbef09993a9ad2adba6ca6e", - "sha256:7e50d0a0cc3189f9cb0aeb3a6a6af18c16f59f004b866cd2be1c14b36134a4a0", - "sha256:95a7476c59002f2f6c590b9b7b998306fba6a5aa646b1e22ddfeaf8f78c3a29c", - "sha256:96ff0b2ad353d8f990b63294c8986f1ec3cb19d749234014f4e7eb0112ceba5a", - "sha256:9fad7dcb1aac3c7f0584a5a8133e3a43eeb2fe127f47e3632d43d677c66c102b", - "sha256:9ff0f4f29c51e2803569d7a51c2304de5554655a60c5d776e35b4a41413830d0", - "sha256:a354325ee03388678242a4d7ebcd08b5c727033fcff3b2f536aea978e15ee9e6", - "sha256:a4abb4f9001ad2858e7ac189089c42178fcce737e4169dc61321660f1a96c7d2", - "sha256:ab47dbe5cc8210f55aa58e4805fe224dac469cde56b9f731a4c098b91917159a", - "sha256:afedb719a9dcfc7eaf2287b839d8198e06dcd4cb5d276a3df279231138e83d30", - "sha256:b3ce300f3644fb06443ee2222c2201dd3a89ea6040541412b8fa189341847218", - "sha256:b97fe8060236edf3662adfc2c633f56a08ae30560c56310562cb4f95500022d5", - "sha256:bfe25acf8b437eb2a8b2d49d443800a5f18508cd811fea3181723922a8a82b07", - "sha256:cd25bcecc4974d09257ffcd1f098ee778f7834c3ad767fe5db785be9a4aa9cb2", - "sha256:d209d8969599b27ad20994c8e41936ee0964e6da07478d6c35016bc386b66ad4", - "sha256:d5241e0a80d808d70546c697135da2c613f30e28251ff8307eb72ba696945764", - "sha256:edd8b5fe47dab091176d21bb6de568acdd906d1887a4584a15a9a96a1dca06ef", - "sha256:f870204a840a60da0b12273ef34f7051e98c3b5961b61b0c2c1be6dfd64fbcd3", - "sha256:ffa75af20b44f8dba823498024771d5ac50620e6915abac414251bd971b4529f" - ], - "index": "pypi", - "markers": "python_version >= '3.9'", - "version": "==1.26.4" - }, - "packaging": { - "hashes": [ - "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5", - "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9" - ], - "markers": "python_version >= '3.7'", - "version": "==24.0" - }, - "pathspec": { - "hashes": [ - "sha256:a0d503e138a4c123b27490a4f7beda6a01c6f288df0e4a8b79c7eb0dc7b4cc08", - "sha256:a482d51503a1ab33b1c67a6c3813a26953dbdc71c31dacaef9a838c4e29f5712" - ], - "markers": "python_version >= '3.8'", - "version": "==0.12.1" - }, - "platformdirs": { - "hashes": [ - "sha256:2d7a1657e36a80ea911db832a8a6ece5ee53d8de21edd5cc5879af6530b1bfee", - "sha256:38b7b51f512eed9e84a22788b4bce1de17c0adb134d6becb09836e37d8654cd3" - ], - "markers": "python_version >= '3.8'", - "version": "==4.2.2" - } - }, - "develop": {} -} diff --git a/README.md b/README.md index a7fe17d..ce244cb 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Python -**objective**: an in-depth study of Python, its implementation and ecosystem. - +**objective**: + - An in-depth study of Python's implementation and ecosystem. + - This focuses on [CPython](https://github.com/python/cpython). + [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) ## Language Details: @@ -9,6 +11,8 @@ - [base modules index](https://docs.python.org/3/py-modindex.html) - [standard library reference](https://docs.python.org/3.11/library/index.html) - [packaging and distribution](https://packaging.python.org/en/latest/) + - [python packaging authority](https://www.pypa.io/en/latest/) + - [glossary](https://packaging.python.org/en/latest/glossary/) - tools: - [pip](https://pypi.org/project/pip/) - [pipenv](https://pipenv.pypa.io/en/latest/) @@ -16,7 +20,9 @@ - [package index](https://pypi.org) - [extending and embedding](https://docs.python.org/3.11/extending/index.html) - [developer contribution guide](https://devguide.python.org/) - - [compiler/interpreter](https://github.com/python/cpython) + - compiler/interpreter: + - [cpython implementation](https://github.com/python/cpython) + - [Bennett, J. 2019. See CPython run: Getting to know your Python interpreter. North Bay Python](https://www.youtube.com/watch?v=tzYhv61piNY) - memory model: - [computational complexity cost model](https://ocw.mit.edu/courses/6-006-introduction-to-algorithms-fall-2011/pages/readings/python-cost-model/) - history: @@ -32,6 +38,11 @@ - [roadmap](https://roadmap.sh/python) - [practice problems](https://www.hackerrank.com/domains/python?filters%5Bstatus%5D%5B%5D=unsolved&badge_type=python) +## Spell Check: + +```shell +pyspelling -c spellcheck.yaml +``` # References: diff --git a/dictionary.dic b/dictionary.dic new file mode 100644 index 0000000..88cad2f Binary files /dev/null and b/dictionary.dic differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..5114d74 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,3 @@ +-i https://pypi.org/simple +numpy==2.2.3; python_version >= '3.10' +pyspelling==2.10 \ No newline at end of file diff --git a/setup.sh b/setup.sh index 6352a8e..3903b68 100755 --- a/setup.sh +++ b/setup.sh @@ -1,26 +1,26 @@ -echo "adding asdf python plugin" +echo "Adding asdf python plugin" asdf plugin add python -echo "done" +echo "Done" ostype="$(uname -s)" if [ "$ostype" = "Linux" ]; then - echo "install openssl dependecy" + echo "install openssl dependency" sudo apt install libedit-dev - echo "done" + echo "Done" fi -echo "installing python" +echo "Installing python" asdf install python latest -echo "done" +echo "Done" -echo "set latest version to system wide version" +echo "Set latest version to system wide version" asdf global python latest -echo "done" +echo "Done" -echo "installing pipenv" +echo "Installing pipenv" brew install pipenv -echo "done" +echo "Done" echo "installing system level Black in python" pip3 install black -echo "done" +echo "Done" diff --git a/spellcheck.yaml b/spellcheck.yaml new file mode 100644 index 0000000..e1ea332 --- /dev/null +++ b/spellcheck.yaml @@ -0,0 +1,14 @@ +matrix: + - name: All Files + aspell: + lang: en + ignore-case: false + dictionary: + wordlists: + - .spellcheck_exceptions_dictionary.txt + encoding: utf-8 + sources: + - "**/*.md" + - "**/*.tex" + - "**/*.txt" + default_encoding: utf-8 diff --git a/src/0_implementations/0_def.txt b/src/0_implementations/0_def.txt index 1746081..9fac156 100644 --- a/src/0_implementations/0_def.txt +++ b/src/0_implementations/0_def.txt @@ -21,3 +21,4 @@ Known implementations (Python Software Foundation, 2023): References: Python Software Foundation. 2023. The Python Language Reference. https://docs.python.org/3.11/reference/introduction.html#alternate-implementations. + \ No newline at end of file diff --git a/src/0_implementations/1_lexical_and_syntactical_BNF_notation.txt b/src/0_implementations/1_lexical_and_syntactical_BNF_notation.txt index ee5e614..841fbac 100644 --- a/src/0_implementations/1_lexical_and_syntactical_BNF_notation.txt +++ b/src/0_implementations/1_lexical_and_syntactical_BNF_notation.txt @@ -1 +1 @@ -def: TBD \ No newline at end of file +def: ??? \ No newline at end of file diff --git a/src/1_lexical_analysis/0_line_structure/6_indentation.txt b/src/1_lexical_analysis/0_line_structure/6_indentation.txt index ed5226c..580d2c0 100644 --- a/src/1_lexical_analysis/0_line_structure/6_indentation.txt +++ b/src/1_lexical_analysis/0_line_structure/6_indentation.txt @@ -21,7 +21,7 @@ def indentation (Python Software Foundation, 2023): print("2") is less than that, hence it fails with IndentationError. - properties: - total spaces preceding - first non-blank character determine's the line indentation. + first non-blank character determines the line indentation. - cannot be split across physical lines with '\'. - white space preceding first '\' terminates indentation - invalid if contains inconsistent use of tabs and spaces. diff --git a/src/1_lexical_analysis/1_tokens/1_identifiers(names).txt b/src/1_lexical_analysis/1_tokens/1_identifiers(names).txt index 59397b2..5e6e823 100644 --- a/src/1_lexical_analysis/1_tokens/1_identifiers(names).txt +++ b/src/1_lexical_analysis/1_tokens/1_identifiers(names).txt @@ -37,7 +37,7 @@ reserved classes of identifiers (Python Software Foundation, 2023): - __* : private class members - through name mangling are renamed to using patter : classname__* example: - see: ./src/1_identifiers(names)_class_subtyping_overrides.py + see: ./src/1_identifiers(names)_class_sub_typing_overrides.py - this is to help prevent name overriding in class hierarchies diff --git a/src/1_lexical_analysis/1_tokens/1_identifiers(names)_class_subtyping_overrides.py b/src/1_lexical_analysis/1_tokens/1_identifiers(names)_class_sub_typing_overrides.py similarity index 100% rename from src/1_lexical_analysis/1_tokens/1_identifiers(names)_class_subtyping_overrides.py rename to src/1_lexical_analysis/1_tokens/1_identifiers(names)_class_sub_typing_overrides.py diff --git a/src/2_datamodel/0_objects_values_and_types/def.txt b/src/2_datamodel/0_objects_values_and_types/def.txt index 5efe597..4880ee9 100644 --- a/src/2_datamodel/0_objects_values_and_types/def.txt +++ b/src/2_datamodel/0_objects_values_and_types/def.txt @@ -5,8 +5,6 @@ What is the Data model? id() type() -gc module? - References: Python Software Foundation. 2023. Objects, values and types. https://docs.python.org/3.12/reference/datamodel.html#objects-values-and-types \ No newline at end of file diff --git a/src/3_execution_model/3_names_and_name_binding_name_locality.txt b/src/3_execution_model/3_names_and_name_binding_name_locality.txt index 22c6e45..f1d8685 100644 --- a/src/3_execution_model/3_names_and_name_binding_name_locality.txt +++ b/src/3_execution_model/3_names_and_name_binding_name_locality.txt @@ -1,6 +1,7 @@ def name: sequence of characters that refer to objects (Python Software Foundation, 2023). - def object: TBD. + + def object: ???. def name binding (Python Software Foundation, 2023): the act of introducing a name to point/refer to an object. @@ -29,7 +30,8 @@ def name binding (Python Software Foundation, 2023): the act of introducing a na - as-in structural pattern matching. - in a capture pattern in structural pattern matching. - targets of 'del' as considered bound too - def targets: TBD + + def targets: ??? - name locality: - names defined in block are local to the block diff --git a/src/packaging_and_distribution/modules/REAMDE.md b/src/packaging_and_distribution/modules/REAMDE.md index 16ead6a..80ed158 100644 --- a/src/packaging_and_distribution/modules/REAMDE.md +++ b/src/packaging_and_distribution/modules/REAMDE.md @@ -1,7 +1,7 @@ def: module: a collection of code 1 type of module object all modules are of this type - independent of technolgy(e..g python, C, etc) + independent of technology(e..g python, C, etc) has: name @@ -10,7 +10,7 @@ def: module: a collection of code whole module code ran, top to bottom and left to right cached in sys.modules -def: package: special kind of module for organising other modules +def: package: special kind of module for organizing other modules has: __path__ attribute @@ -20,7 +20,7 @@ def: package: special kind of module for organising other modules metaphor: package := directories on a file system, then module := files in the directories - sub modules access nootation + sub modules access notation parent.child.child... e.g. email.mime.text @@ -48,12 +48,12 @@ def: package: special kind of module for organising other modules only their __init__.py is executed namespace package: - def: composite of various portions - each portiion constributes a subpackage - to the parent package. + def: composite of various portions + each portion contributes a sub-package + to the parent package. properties: - portions can exist anywhere Python searhces during module import - they may/may not correspond directly to objects on a file sytem; + portions can exist anywhere Python searches during module import + they may/may not correspond directly to objects on a file system; can be virtual modules with no concrete representation. __path__ : custom iterable type parent/__init__.py is NOT required