404
+ +Page not found
+ + +diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 98c9f2e..0000000 --- a/.gitignore +++ /dev/null @@ -1,30 +0,0 @@ -# the virtual environment -.venv/ - -# vs code ctags -.vscode/tags - -# python bulid files -dist/ -*.egg-info/ - -# cache compiled files -**/__pycache__/ -*.pyc -*.pyo - -# jupyter checkpoint folders -**/.ipynb_checkpoints/ - -# mkdocs site folder -site/ - -# mypy cache folder -.mypy_cache/ - -# pytest cache folder -.pytest_cache/ -.coverage - -# tox cache folder -.tox/ \ No newline at end of file diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index bc22d27..0000000 --- a/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: python -python: - - "3.7-dev" # https://github.com/travis-ci/docs-travis-ci-com/blob/master/user/languages/python.md -install: - - pip install -U pip - - sudo apt-get install python-enchant - - curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python - - source $HOME/.poetry/env - - poetry install -v -script: - - poetry run pytest --cov=python_package tests -W ignore \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index baa5649..0000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - // See http://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - // List of extensions which should be recommended for users of this workspace. - "recommendations": [ - "ms-vscode.sublime-keybindings", - "streetsidesoftware.code-spell-checker", - "bungcip.better-toml", - "wakatime.vscode-wakatime", - "jaydenlin.ctags-support", - "ms-python.python", - ], - // List of extensions recommended by VS Code that should not be recommended for users of this workspace. - "unwantedRecommendations": [] -} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 69f617a..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "python.pythonPath": ".venv/bin/python", - "files.exclude": { - "site": true, - ".tox": true, - ".mypy_cache": true, - ".pytest_cache": true, - ".coverage": true, - "*.egg-info": true - }, - "cSpell.words": [ - "cname", - "unittest", - "isort", - "envvar", - "levelname", - "asctime", - "getenv", - "pydocstyle", - "mkdir", - "mypy", - "pathlib", - "subdomain", - "bungcip", - "toml", - "jupyter", - "ipykernel", - "jaydenlin", - "ctags", - "pylint", - "yapf", - "conda", - "checkinstall", - "gplv", - "libncursesw", - "libssl", - "libsqlite", - "libgdbm", - "libc", - "libreadline", - "libbz", - "libffi", - "altinstall", - "chown", - "venv", - "jupyterlab", - "ipython", - "pyproject", - "kernelspec", - "readlink", - "virtualenvs", - "mkdocs", - "pytest", - "kubernetes", - "cookiecutter", - "streetsidesoftware" - ] -} \ No newline at end of file diff --git a/404.html b/404.html new file mode 100644 index 0000000..399b95f --- /dev/null +++ b/404.html @@ -0,0 +1,129 @@ + + + +
+ + + + + + +Page not found
+ + +Please consult the project page on GitHub for a full overview of the available features.
+ +We will need python to be installed but we don't want to use conda the package manager. The main reason for this, is to break free from the conflict issues mentioned here and to only use semi-standard tools like poetry with pip. We can go the route of using Docker containers to install python as described here and run it using bash aliases similar to this. However, we will use a different approach.
+You are encouraged not to override the default python installation in your linux machine. Instead, have an independent installation which you use to create virtual environments.
+# source: https://tecadmin.net/install-python-3-7-on-ubuntu-linuxmint/
+
+# install the dependencies
+sudo apt-get install build-essential checkinstall
+sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev \
+ libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
+
+# download the source code
+cd /usr/src
+sudo wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz
+sudo tar xvf Python-3.7.2.tar.xz
+
+# compile the source code
+cd Python-3.7.2
+sudo ./configure --enable-optimizations
+sudo make altinstall # use altinstall to prevent replacing the default python
+
+# if you faced a warning message in the make like
+# "... directory is not owned by the current user and the cache has been disabled ..."
+# do the following
+sudo chown $USER: /home/$USER/.cache/pip
+
+# now it should be installed and available if you run
+python3.7 -V
+pip3.7 -V
+
+# now create a root virtual environment
+
+
+You are always encouraged to use virtual environments instead of working on the original python installation. Therefore, we will install venv and use it to create a root virtual environment and put it in ~/.python/bin.
python3.7 -m venv ~/.python --prompt py
+
+
+If you didn't install Python 3.7, you can use this:
+sudo apt-get install python3-venv
+python3 -m venv ~/.python
+
+
+This way, even if we missed up when installing dependencies and we wanted to start from a clean python installation, we can just delete the environment and create a clean new one.
+rm -rf ~/.python
+python3.7 -m venv ~/.python --prompt py
+
+
+To activate the environment:
+source ~/.python/bin/activate
+
+
+In vs.code-workspace, we are making this as the default virtual environment. However, we will be overriding it with the virtual environment that will be created later using poetry.
Refer to the documentation page:
+~/.python/bin/pip install jupyterlab
+
+# create a link and make jupyter and ipython available anywhere
+# this assumes ~/.local/bin is in PATH
+ln -s ~/.python/bin/jupyter ~/.local/bin/
+ln -s ~/.python/bin/ipython ~/.local/bin/
+
+
+To see the list of added kernels to jupyter and edit them:
+jupyter kernelspec list
+# jupyter kernelspec uninstall bad_kernel
+
+
+To list any newly created virtual environment in jupyter, you need to activate it first then:
+pip install ipykernel
+python -m ipykernel install --user --name awesome_kernel
+
+
+Now to run jupyterlab:
+jupyter lab
+
+
+Refer to the GitHub page:
+~/.python/bin/pip install poetry
+ln -s ~/.python/bin/poetry ~/.local/bin/
+poetry config settings.virtualenvs.in-project true
+
+
+To enable tab completion for Bash, run this and restart the terminal:
+poetry completions bash > poetry.bash-completion
+sudo mv poetry.bash-completion /etc/bash_completion.d
+
+
+Now clone this repository and install it using poetry. The goal is to create a new virtual environment, which will be used for development:
+git clone https://github.com/ModarTensai/python-package
+cd python-package
+poetry install --extras jupyter
+
+
+If you pass --no-dev to poetry install, the dev-dependencies in pyproject.toml will not be installed. Refer to the documentation for more information.
To run anything in this new virtual environment use:
+poetry run python -V
+# poetry shell # use this to spawn inside the environment
+
+
+For example, to add this virtual environment to jupyter:
+poetry run pip install ipykernel
+poetry run python -m ipykernel install --user --name python_package
+
+
+If you want to remove it later from jupyter:
+jupyter kernelspec uninstall python_package
+
+
+To clear the cache and recreate the virtual environment again, you need to delete it first:
+rm -rf .venv
+poetry cache:clear --all .
+poetry install --extras jupyter
+
+
+If you didn't enable the in-project virtual environment setting:
+# instead of running: rm -rf .venv
+# get the directory of the environment and remove it
+rm -rf $(dirname $(dirname $(poetry run which python)))
+
+
+
+
+