Skip to content

Commit

Permalink
Use a pyproject.toml (#4)
Browse files Browse the repository at this point in the history
* Move setup.py at top level and add a pyproject.toml

It make it easier to install directly with a `pip install git+https://github.com/Baduit/cydoomgenericr`

* Move url from setupt.py to pyproject.toml

The setup.py now only contains stuff related to the cython extension.

* Update github action

There is no need to install the requirements manually, with the pyproject.toml it is done automatically

Use the modern replacement for buildind wheels (instead of the python setup.py bdist_wheel)

* Update build/install instruction in the readme

* Add myself in the copyright at the top

* Change build commands in README.

---------

Co-authored-by: Wojciech Graj <wojtek.graj.2004@gmail.com>
  • Loading branch information
Baduit and wojciech-graj authored Oct 21, 2024
1 parent dcfa102 commit 735b4e4
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 21 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
working-directory: ${{github.workspace}}/cydoomgeneric
- name: Install cydoomgeneric
run: |
python -m pip install --upgrade pip
python -m pip install numpy cython wheel
python -m pip install .
- name: Install build
run: |
python -m pip install build
- name: Build wheel
working-directory: ${{github.workspace}}/cydoomgeneric
run: |
python setup.py bdist_wheel
python -m build --wheel
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,10 @@ Some additional documentation can be found in `cydoomgeneric/cydoomgeneric.pyx`.

## Building

The following python packages are required: `numpy cython`.

To build and install cydoomgeneric, run the following commands:
To build and install cydoomgeneric, run the following command:

```
$ cd cydoomgeneric
$ python setup.py install
$ pip install .
```

## Demo Screenshots
Expand Down
18 changes: 18 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[build-system]
requires = ["setuptools", "cython", "numpy>=1.20"]
build-backend = "setuptools.build_meta"

[project]
name = "cydoomgeneric"
description = "Easily portable doom for python"
version = "0.1.0"
authors = [
{name = "Wojciech Graj"}
]
license = {file = "LICENSE"}

[project.urls]
homepage = "https://github.com/wojciech-graj/cydoomgeneric"

[tool.setuptools]
py-modules = []
14 changes: 4 additions & 10 deletions cydoomgeneric/setup.py → setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""
Copyright(C) 2023-2024 Wojciech Graj
Copyright(C) 2024 Lena Bertho
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
Expand Down Expand Up @@ -123,22 +124,16 @@


setup(
name="cydoomgeneric",
description="Easily portable doom for python",
version="0.1.0",
author="Wojciech Graj",
url="https://github.com/wojciech-graj/cydoomgeneric",
license="GPL-2.0-or-later",
ext_modules=cythonize(
[
Extension(
"cydoomgeneric",
sources=[
"./cydoomgeneric.pyx"
"./cydoomgeneric/cydoomgeneric.pyx"
]
+ [f"./../doomgeneric/{src}" for src in doom_src],
+ [f"./doomgeneric/{src}" for src in doom_src],
include_dirs=[
"./../doomgeneric",
"./doomgeneric",
numpy.get_include()
],
define_macros=define_macros,
Expand All @@ -150,5 +145,4 @@
language_level=3,
compiler_directives=compiler_directives
),
install_requires=['numpy>=1.20']
)

0 comments on commit 735b4e4

Please sign in to comment.