Python Package
Contents
Python Package#
Author: Fu Yin
Update: Dec 15, 2022
Reading: 60 min
Setup Tool#
Poetry#
Follow the instructions below: https://ealizadeh.com/blog/guide-to-python-env-pkg-dependency-using-conda-poetry/
Use
conda
create a new environment, only installpython
conda env create -f environment.yml # create env according to .yml file conda env export > environment.yml # export .yml file conda activate jupiter-dev # activate env
Use
poetry
install other python packageInstall poetry firstly
curl -sSL https://install.python-poetry.org | python3 - # do not use pip mkdir $ZSH_CUSTOM/plugins/poetry # add poetry into oh-my-zsh plugins poetry completions zsh > $ZSH_CUSTOM/plugins/poetry/_poetry
poetry config virtualenvs.create false # do not allow poetry create env
poetry init # this command will create pyproject.toml file
poetry install # this command will install some package mentioned in 'pyproject.toml', and also generate a 'poetry.lock' file
# Now you can change 'pyproject.toml' by hand
poetry update # update the new info in 'pyproject.toml' into 'poetry.lock' file
Sphnix#
Github Action#
Buy and Bind Domain Name with Github Pages#
Buy from Namesilo#
The default domain-name in github pages is your_name.github.io
, but you can set your own domain-name. Firstly, buy a domain-name; I got yinfu.info
domain-name from Namesilo, the purchase process is showing below:
Create an account and check your favorite domain-name whether be used or not, then just buy it. Now use Namesilo to resolve the domain-name: click on the blue ball
to edit DNS
; you can set by yourself or using the template provided below. Generally setting example.com
and www.example.com
to point to your own server IP address is sufficent, set A
and CNAME
:
My domain-name information:

Fig. 11 My Domain Name Info#
For
A
:
HOSTNAME |
TYPE |
ADDRESS/VALUE |
---|---|---|
none |
A |
185.199.108.153 |
Admonition
Use ping OUCyf.github.io
to get id of ADDRESS/VALUE
For
CNAME
:
HOSTNAME |
TYPE |
ADDRESS/VALUE |
---|---|---|
www |
CNAME |
The screenshot of my setting:

Fig. 12 My Setting#
Renew domains
Click
Renew Domains
thenCHECKOUT
.
Bind with Github#
Add the CNAME
file to the github Pages repository at root directory and write your domain name inside:

Fig. 13 CNAME File in Github#
Or set custom domain
directly to Github Pages
in Settings
of github. Github will automatically adds the CNAME
file.

Fig. 14 Github Page#
Enforce HTTPS
which provides a layer of encryption that prevents others from snooping on or tampering with traffic to your site. When HTTPS
is enforced, your site will only be served over HTTPS
instead of HTTP
.