Skip to content

Commit 26d9d69

Browse files
committed
add pip build.
1 parent 0fb7810 commit 26d9d69

File tree

6 files changed

+106
-0
lines changed

6 files changed

+106
-0
lines changed

LICENSE.txt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright © 2021 Michael Moser
4+
5+
6+
Permission is hereby granted, free of charge, to any person obtaining a copy
7+
of this software and associated documentation files (the “Software”), to deal
8+
in the Software without restriction, including without limitation the rights
9+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
copies of the Software, and to permit persons to whom the Software is
11+
furnished to do so, subject to the following conditions:
12+
13+
The above copyright notice and this permission notice shall be included in
14+
all copies or substantial portions of the Software.
15+
16+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
THE SOFTWARE.

build-pip.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/bash
2+
3+
set -ex
4+
5+
# remove files not under git
6+
git clean -f -d
7+
8+
mkdir -p staging_dir/src/pyasmtools
9+
mkdir -p staging_dir/tests
10+
11+
cp pyasmtools/*.py staging_dir/src/pyasmtools
12+
cp requirements.txt staging_dir/
13+
cp LICENSE.txt README.md staging_dir
14+
cp pip-build/* staging_dir
15+
16+
if [[ -f build.zip ]]; then
17+
rm build.zip
18+
fi
19+
20+
pushd staging_dir
21+
python3 setup.py sdist bdist_wheel
22+
23+
python3 -m pip install --user --upgrade twine
24+
25+
# twine is put here right now, so add it to path.
26+
export PATH=$HOME/Library/Python/3.9/bin:$PATH
27+
28+
twine check dist/*
29+
30+
cat <<EOF
31+
*** upload ***
32+
enter user: __token__
33+
for password: <pypi api token>
34+
EOF
35+
36+
python3 -m twine upload --verbose dist/*
37+
38+
popd
39+
40+
41+
echo "*** build completed ***"
42+

pip-build/pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=42",
4+
"wheel"
5+
]
6+
build-backend = "setuptools.build_meta"

pip-build/setup.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import os
2+
import setuptools
3+
4+
def read(fname):
5+
with open(os.path.join(os.path.dirname(__file__), fname), encoding="utf-8") as file:
6+
return file.read()
7+
8+
install_requires = read("requirements.txt")
9+
install_requires = install_requires.split("\n")
10+
install_requires = list(filter(lambda x: x[0:1] != "#", install_requires))
11+
print("install-requires:", install_requires)
12+
13+
setuptools.setup(
14+
name = "pyasmtools",
15+
version = "1.0.3",
16+
author = "Michael Moser",
17+
author_email = "moser.michael@gmail.com",
18+
description = ("a python bytecode disassembler and execution tracer, all done as decorators."),
19+
license = "MIT",
20+
keywords = "utility",
21+
url = "https://github.com/MoserMichael/pyasmtools",
22+
package_dir={'': 'src'},
23+
packages=setuptools.find_packages("src"),
24+
long_description=read('README.md'),
25+
long_description_content_type='text/markdown',
26+
install_requires=install_requires,
27+
classifiers=[
28+
"Programming Language :: Python :: 3",
29+
"License :: OSI Approved :: MIT License",
30+
"Operating System :: OS Independent",
31+
"Topic :: Software Development :: Debuggers"
32+
],
33+
python_requires='>=3.6',
34+
)

pyasmtools/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from .prettydiasm import *
2+
from .prettytrace import *

requirements.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)