Skip to content

Commit 18f7dc4

Browse files
committed
migrate to pyproject.toml
1 parent 5c670cd commit 18f7dc4

File tree

4 files changed

+49
-23
lines changed

4 files changed

+49
-23
lines changed

.github/workflows/python-package.yml

+3-6
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
python-version: [3.8, 3.9, "3.10", 3.11]
1919

2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
2222
- name: Set up Python ${{ matrix.python-version }}
23-
uses: actions/setup-python@v2
23+
uses: actions/setup-python@v4
2424
with:
2525
python-version: ${{ matrix.python-version }}
2626
- name: Install dependencies
@@ -30,10 +30,7 @@ jobs:
3030
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
3131
- name: Lint with flake8
3232
run: |
33-
# stop the build if there are Python syntax errors or undefined names
34-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
33+
flake8 . --max-line-length=127
3734
- name: Test with pytest
3835
run: |
3936
pytest

.github/workflows/python-publish.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ jobs:
1313
runs-on: ubuntu-latest
1414

1515
steps:
16-
- uses: actions/checkout@v2
16+
- uses: actions/checkout@v3
1717
- name: Set up Python
18-
uses: actions/setup-python@v2
18+
uses: actions/setup-python@v4
1919
with:
2020
python-version: '3.x'
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
24+
pip install setuptools wheel twine build
2525
- name: Build and publish
2626
env:
2727
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
2828
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
2929
run: |
30-
python setup.py sdist bdist_wheel
30+
python3 -m build
3131
twine upload dist/*

pyproject.toml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
[project]
2+
name = "simpleelf"
3+
version = "0.1.12"
4+
description = "Simple ELF parser and builder"
5+
readme = "README.md"
6+
requires-python = ">=3.8"
7+
license = { file = "LICENSE" }
8+
keywords = ["elf", "reverse-engineering", "research"]
9+
authors = [
10+
{ name = "doronz88", email = "doron88@gmail.com" }
11+
]
12+
maintainers = [
13+
{ name = "doronz88", email = "doron88@gmail.com" }
14+
]
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
18+
"Programming Language :: Python :: 3",
19+
"Programming Language :: Python :: 3.8",
20+
"Programming Language :: Python :: 3.9",
21+
"Programming Language :: Python :: 3.10",
22+
"Programming Language :: Python :: 3.11",
23+
"Programming Language :: Python :: 3 :: Only",
24+
]
25+
dynamic = ["dependencies"]
26+
27+
[project.optional-dependencies]
28+
test = ["pytest"]
29+
30+
[project.urls]
31+
"Homepage" = "https://github.com/doronz88/simpleelf"
32+
"Bug Reports" = "https://github.com/doronz88/simpleelf/issues"
33+
34+
[tool.setuptools.packages.find]
35+
exclude = ["docs*", "tests*"]
36+
37+
[tool.setuptools.dynamic]
38+
dependencies = { file = ["requirements.txt"] }
39+
40+
[build-system]
41+
requires = ["setuptools>=43.0.0", "wheel"]
42+
build-backend = "setuptools.build_meta"

setup.py

-13
This file was deleted.

0 commit comments

Comments
 (0)