chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
# build and upload easygraph
|
||||
This doc aims to help you with building and uploading easygraph in different OS using pip and conda.
|
||||
|
||||
## Using Pip
|
||||
|
||||
### Windows
|
||||
|
||||
#### build easygraph
|
||||
|
||||
1.Get the source code and cd to your project
|
||||
|
||||
git clone https://github.com/easy-graph/Easy-Graph.git
|
||||
cd to your project
|
||||
|
||||
2.run the script in powershell
|
||||
|
||||
./build_easygraph_windows.bat
|
||||
【Note】 The premise is that you have to install prerequisites according to the comments in the script.
|
||||
|
||||
|
||||
|
||||
#### upload easygraph
|
||||
|
||||
cd to your project
|
||||
python -m twine upload dist/*
|
||||
|
||||
### MacOS
|
||||
|
||||
#### build easygraph
|
||||
|
||||
1.Get the source code and cd to your project
|
||||
|
||||
git clone https://github.com/easy-graph/Easy-Graph.git
|
||||
cd to your project
|
||||
|
||||
2.run the script
|
||||
|
||||
bash/zsh scripts/build_easygraph_macos.sh
|
||||
【Note】 The premise is that you have to install prerequisites according to the comments in the script.
|
||||
|
||||
|
||||
|
||||
#### upload easygraph
|
||||
|
||||
run the script:
|
||||
|
||||
bash/zsh scripts/upload_easygraph.sh
|
||||
|
||||
### Linux
|
||||
|
||||
#### build easygraph
|
||||
|
||||
1.Get the source code and cd to your project
|
||||
|
||||
git clone https://github.com/easy-graph/Easy-Graph.git
|
||||
cd /Easy-Graph
|
||||
|
||||
2.run the script:
|
||||
|
||||
bash/zsh scripts/build_easygraph_linux.sh
|
||||
【Note】 The premise is that you have to install prerequisites according to the comments in the script.
|
||||
|
||||
#### upload easygraph
|
||||
|
||||
modify the **docker name** in upload_easygraph.sh, then:
|
||||
|
||||
bash/zsh scripts/upload_easygraph.sh
|
||||
|
||||
|
||||
|
||||
### Verify
|
||||
The verify process is the same in all OS.
|
||||
1. pip cache purge
|
||||
2. pip uninstall Python-EasyGraph
|
||||
3. pip install -i https://pypi.Python.org/simple/ Python-EasyGraph
|
||||
|
||||
If the download file is whl, it means that your build&upload process is successful.
|
||||
|
||||
|
||||
## Using conda
|
||||
|
||||
Refer to https://conda.io/projects/conda-build/en/latest/user-guide/tutorials/build-pkgs-skeleton.html
|
||||
|
||||
### run the commands below in Mac, Linux and Windows
|
||||
conda build --python 3.6 Easy-Graph
|
||||
conda build --python 3.7 Easy-Graph
|
||||
conda build --python 3.8 Easy-Graph
|
||||
conda build --python 3.9 Easy-Graph
|
||||
|
||||
Finaly, you are free to change all the script to your taste.
|
||||
@@ -0,0 +1,29 @@
|
||||
# Solution Doc
|
||||
|
||||
This doc aims to record the problem encountered during packaging.
|
||||
|
||||
## pip
|
||||
|
||||
### Windows
|
||||
|
||||
|
||||
### Mac
|
||||
|
||||
* Q: ERROR: Package 'python-easygraph' requires a different Python: 3.9.10 not in '<=3.9,>=3.6'
|
||||
|
||||
A : you might need to update dependencies to compatibility: https://stackoverflow.com/questions/66593103/why-does-pip-claim-that-a-version-of-python-is-not-in-a-given-range
|
||||
|
||||
### Linux
|
||||
|
||||
## conda
|
||||
|
||||
### Windows
|
||||
|
||||
* Q: WARNING:conda.gateways.disk.delete:Could not remove or rename ....\cudnn-8.2.1.32-h754d62a_0.tar.bz2. Please remove this file manually (you may need to reboot to free file handles)
|
||||
|
||||
A: https://stackoverflow.com/questions/62215850/warning-conda-gateways-diskunlink-or-rename-to-trash140
|
||||
|
||||
### Mac
|
||||
|
||||
|
||||
### Linux
|
||||
@@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
# Install docker:
|
||||
# https://yeasy.gitbook.io/docker_practice/install/ubuntu#shi-yong-jiao-ben-zi-dong-an-zhuang
|
||||
|
||||
# compiles mac packages for python 3.6、3.7、3.8、3.9
|
||||
# requirements:
|
||||
# docker
|
||||
# quay.io/pypa/manylinux1_x86_64 (docker container)
|
||||
|
||||
export WORKDIR=$HOME/build
|
||||
if [ ! -d "$WORKDIR" ]; then
|
||||
mkdir -p "$WORKDIR"
|
||||
cd "$WORKDIR" || exit
|
||||
git clone https://github.com/easy-graph/Easy-Graph.git
|
||||
fi
|
||||
|
||||
chmod -R 777 "$WORKDIR"/Easy-Graph/
|
||||
cd "$WORKDIR"/Easy-Graph || exit
|
||||
|
||||
docker run -it -v "$WORKDIR":/src --user "$(id -u):$(id -g)" quay.io/pypa/manylinux1_x86_64 /src/Easy-Graph/scripts/build_packages_linux.sh
|
||||
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Install pyenv:
|
||||
# brew install pyenv: https://segmentfault.com/a/1190000016819226
|
||||
#
|
||||
# compiles mac packages for python 3.6、3.7、3.8、3.9
|
||||
# requirements:
|
||||
# pyenv
|
||||
|
||||
export WORKDIR=$HOME/build
|
||||
if [ ! -d "$WORKDIR" ]; then
|
||||
mkdir -p "$WORKDIR"
|
||||
cd "$WORKDIR" || exit
|
||||
git clone https://github.com/easy-graph/Easy-Graph.git
|
||||
fi
|
||||
cd "$WORKDIR"/Easy-Graph || exit
|
||||
|
||||
pip install wheel
|
||||
|
||||
# # compile Python 3.6
|
||||
# pyenv global 3.6.15
|
||||
# time python setup.py bdist_wheel --plat-name macosx-10.9-x86_64
|
||||
|
||||
# compile Python 3.7
|
||||
pyenv global 3.7.9
|
||||
time python setup.py bdist_wheel --plat-name macosx-10.9-x86_64
|
||||
|
||||
# compile Python 3.8
|
||||
pyenv global 3.8.5
|
||||
time python setup.py bdist_wheel --plat-name macosx-10.9-x86_64
|
||||
|
||||
# compile Python 3.9
|
||||
pyenv global 3.9.10
|
||||
time python setup.py bdist_wheel --plat-name macosx-10.9-x86_64
|
||||
@@ -0,0 +1,29 @@
|
||||
REM @echo off
|
||||
REM requirements:
|
||||
REM conda
|
||||
REM
|
||||
REM create envs:
|
||||
REM conda create -n py36 python=3.6.8
|
||||
REM conda create -n py37 python=3.7.9
|
||||
REM conda create -n py38 python=3.8.5
|
||||
REM conda create -n py39 python=3.9.6
|
||||
|
||||
cd ../
|
||||
|
||||
REM compile Python 3.6.8
|
||||
call conda activate py36
|
||||
call python setup.py bdist_wheel
|
||||
|
||||
REM compile Python 3.7.9
|
||||
call conda activate py37
|
||||
call python setup.py bdist_wheel
|
||||
|
||||
REM compile Python 3.8.5
|
||||
call conda activate py38
|
||||
call python setup.py bdist_wheel
|
||||
|
||||
REM compile Python 3.9.6
|
||||
call conda activate py39
|
||||
call python setup.py bdist_wheel
|
||||
|
||||
pause
|
||||
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
cd /src/Easy-Graph/ || exit
|
||||
|
||||
# # compile Python 3.6
|
||||
# PYTHON3=/opt/python/cp36-cp36m/bin/python3
|
||||
# time $PYTHON3 setup.py bdist_wheel
|
||||
# mv dist/*-linux_* "$(ls dist/*-linux_* | sed -e "s/-linux_/-manylinux1_/g")"
|
||||
|
||||
# compile Python 3.7
|
||||
PYTHON3=/opt/python/cp37-cp37m/bin/python3
|
||||
time $PYTHON3 setup.py bdist_wheel
|
||||
mv dist/*-linux_* "$(ls dist/*-linux_* | sed -e "s/-linux_/-manylinux1_/g")"
|
||||
|
||||
# compile Python 3.8
|
||||
PYTHON3=/opt/python/cp38-cp38/bin/python3
|
||||
time $PYTHON3 setup.py bdist_wheel
|
||||
mv dist/*-linux_* "$(ls dist/*-linux_* | sed -e "s/-linux_/-manylinux1_/g")"
|
||||
|
||||
# compile Python 3.9
|
||||
PYTHON3=/opt/python/cp39-cp39/bin/python3
|
||||
time $PYTHON3 setup.py bdist_wheel
|
||||
mv dist/*-linux_* "$(ls dist/*-linux_* | sed -e "s/-linux_/-manylinux1_/g")"
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
|
||||
import easygraph as eg
|
||||
|
||||
|
||||
G = eg.Graph()
|
||||
|
||||
G.add_edge(1, 2)
|
||||
assert G.edges == [(1, 2, {})]
|
||||
|
||||
G.add_node("hello world")
|
||||
G.add_node("Jack", node_attr={"age": 10, "gender": "M"})
|
||||
assert G.nodes == {
|
||||
1: {},
|
||||
2: {},
|
||||
"hello world": {},
|
||||
"Jack": {"node_attr": {"age": 10, "gender": "M"}},
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# GNU/Linux
|
||||
if [ ["$(expr substr $(uname -s) 1 5)" = "Linux"] ]; then
|
||||
# replace xxxx with your docker name
|
||||
docker cp xxxx:/src/Easy-Graph/dist $HOME/dist
|
||||
python -m twine upload $HOME/dist/*
|
||||
|
||||
# Mac OS X
|
||||
else
|
||||
export WORKDIR=$HOME/build
|
||||
if [ ! -d $WORKDIR ]; then
|
||||
echo "dist is not existing"
|
||||
exit 0
|
||||
else
|
||||
cd $WORKDIR/Easy-Graph
|
||||
python -m twine upload dist/*
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user