From be299f41fa8f7131a4277e8558690d96dc18b8b1 Mon Sep 17 00:00:00 2001 From: "Matwey V. Kornilov" Date: Mon, 5 Aug 2024 21:21:02 +0300 Subject: [PATCH] Use pyproject.toml and drop outdated Python support --- .github/workflows/python.yml | 16 +++++----- MANIFEST.in | 5 --- README.md | 1 - pyproject.toml | 32 ++++++++++++++++++++ requirements.txt | 3 -- setup.py | 30 ------------------ test/__init__.py | 4 --- test/{beam_file.py => test_beam_file.py} | 0 test/{schema_beam.py => test_schema_beam.py} | 0 test/{schema_eetf.py => test_schema_eetf.py} | 0 10 files changed, 39 insertions(+), 52 deletions(-) delete mode 100644 MANIFEST.in create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.py delete mode 100644 test/__init__.py rename test/{beam_file.py => test_beam_file.py} (100%) rename test/{schema_beam.py => test_schema_beam.py} (100%) rename test/{schema_eetf.py => test_schema_eetf.py} (100%) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index ea4df39..dba9874 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -16,16 +16,14 @@ jobs: construct-version: ">=2.9,<2.10" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install Dependencies - run: | - python -m pip install --upgrade pip - pip install 'construct${{ matrix.construct-version }}' - pip install -r requirements.txt + - name: Install pybeam + run: python -m pip install . + - name: Install pytest + run: python -m pip install pytest - name: Run Tests - run: | - python setup.py test + run: pytest diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 9540f5b..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include LICENSE -include README.md -include doc/* -include requirements.txt -recursive-include test *.py diff --git a/README.md b/README.md index fcc77ac..4233484 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,6 @@ pybeam ====== Python module to parse Erlang BEAM files. -Both python 2.7 and python 3.3 are supported. Python 3.2 are known not to work. Pull-requests are always welcome. ## Quick start: diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..1cbf5f8 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,32 @@ +[build-system] +requires = ["setuptools >= 61.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "pybeam" +version = "0.7" +description = "Python module to parse Erlang BEAM files" +authors = [ + {name = "Matwey V. Kornilov", email = "matwey.kornilov@gmail.com"}, +] +dependencies = [ + "construct>=2.9,<2.11", +] +requires-python = ">=3.7" +readme = "README.md" +license = {file = "LICENSE"} + +[project.optional-dependencies] +dev = [ + "pytest", +] + +[project.urls] +Repository = "https://github.com/matwey/pybeam.git" +Issues = "https://github.com/matwey/pybeam/issues" + +[tool.pytest.ini_options] +testpaths = [ + "pybeam", + "test", +] diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 0420b06..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -construct>=2.9,<2.11 -six -sphinx diff --git a/setup.py b/setup.py deleted file mode 100644 index 78fb51b..0000000 --- a/setup.py +++ /dev/null @@ -1,30 +0,0 @@ -from setuptools import find_packages, setup -try: - from sphinx.setup_command import BuildDoc - cmdclass = {'build_sphinx': BuildDoc} -except ImportError: - pass - -name="pybeam" -version="0.7" -test_suite="test" - -setup(name=name, - version=version, - description='Python module to parse Erlang BEAM files', - url='http://github.com/matwey/pybeam', - author='Matwey V. Kornilov', - author_email='matwey.kornilov@gmail.com', - license='MIT', - packages=find_packages(exclude=(test_suite,)), - test_suite=test_suite, - install_requires=['construct>=2.9,<2.11', 'six'], - command_options={ - 'build_sphinx': { - 'project': ('setup.py', name), - 'version': ('setup.py', version), - 'release': ('setup.py', version), - 'source_dir': ('setup.py', 'doc') - } - }, - zip_safe=False) diff --git a/test/__init__.py b/test/__init__.py deleted file mode 100644 index 3a70e52..0000000 --- a/test/__init__.py +++ /dev/null @@ -1,4 +0,0 @@ -from test.schema_beam import BEAMConstructTest -from test.schema_eetf import EETFConstructTest -from test.beam_file import BEAMFileTest -import unittest diff --git a/test/beam_file.py b/test/test_beam_file.py similarity index 100% rename from test/beam_file.py rename to test/test_beam_file.py diff --git a/test/schema_beam.py b/test/test_schema_beam.py similarity index 100% rename from test/schema_beam.py rename to test/test_schema_beam.py diff --git a/test/schema_eetf.py b/test/test_schema_eetf.py similarity index 100% rename from test/schema_eetf.py rename to test/test_schema_eetf.py