Skip to content

Commit 217985e

Browse files
Move libsemigroups_pybind11 to src
1 parent 877bfed commit 217985e

35 files changed

+13
-116
lines changed

CONTRIBUTING.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,14 @@ A class with no helpers or templates
208208
____________________________________
209209

210210
If the class you are binding has no templates or helper functions, then you
211-
need to add it to the list imports in `<libsemigroups_pybind11/__init__.py>`__.
211+
need to add it to the list imports in
212+
`<src/libsemigroups_pybind11/__init__.py>`__.
212213

213214
A class with helpers
214215
____________________
215216

216217
If a class has a helper namespace, this should be respected in Python by
217-
creating a module with the same name in the ``libsemigroups_pybind11``
218+
creating a module with the same name in the ``src/libsemigroups_pybind11``
218219
directory. In that module, all of the relevant helper functions should be
219220
imported from ``_libsemigroups_pybind11``.
220221

@@ -226,7 +227,7 @@ will be one class for each combination of templates. Instead of calling these
226227
directly, a Python function should be created that acts as a constructor, that
227228
then calls the the corresponding ``_libsemigroups_pybind11`` constructor
228229
depending on the keyword arguments specified. This function should then be
229-
imported in `<libsemigroups_pybind11/__init__.py>`__.
230+
imported in `<src/libsemigroups_pybind11/__init__.py>`__.
230231

231232
The documentation
232233
-----------------
@@ -439,10 +440,10 @@ whilst contributing are::
439440
│ └── index.rst
440441
├── etc/
441442
│ └── replace-string-in-doc.py
442-
├── libsemigroups_pybind11/
443-
│ ├── __init__.py
444-
│ └── class_name.py
445443
├── src/
444+
| ├──libsemigroups_pybind11/
445+
│ | ├── __init__.py
446+
│ | └── class_name.py
446447
│ └── class-name.cpp
447448
├── tests/
448449
│ └── test_class_name.py

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ install:
1919
pip3 install . --use-feature=in-tree-build
2020

2121
black:
22-
black setup.py tests/*.py libsemigroups_pybind11/*.py docs/source/conf.py
22+
black setup.py tests/*.py src/libsemigroups_pybind11/*.py docs/source/conf.py
2323

2424
check: doctest
2525
pytest -vv tests/test_*.py
2626

2727
lint:
28-
ruff check --exit-zero setup.py tests/*.py libsemigroups_pybind11/*.py docs/source/*.py
29-
pylint --exit-zero setup.py tests/*.py libsemigroups_pybind11/*.py libsemigroups_pybind11/**/*.py
28+
ruff check --exit-zero setup.py tests/*.py src/libsemigroups_pybind11/*.py docs/source/*.py
29+
pylint --exit-zero setup.py tests/*.py src/libsemigroups_pybind11/*.py src/libsemigroups_pybind11/**/*.py
3030
cpplint src/*.hpp src/*.cpp
3131

3232
coverage:
@@ -39,8 +39,8 @@ clean-doc:
3939
rm -rf docs/_build
4040

4141
clean: clean-doc
42-
rm -rf __pycache__ libsemigroups_pybind11.egg-info
43-
rm -rf tests/__pycache__ libsemigroups_pybind11/__pycache__
42+
find . -type d -name __pycache__ -prune -exec rm -rf {} \;
43+
rm -rf libsemigroups_pybind11.egg-info
4444
rm -f *.whl
4545
rm -rf build/
4646

libsemigroups_pybind11/tools.py

Lines changed: 0 additions & 99 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 3 deletions
This file was deleted.

libsemigroups_pybind11/__init__.py renamed to src/libsemigroups_pybind11/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
This package provides the user-facing python part of libsemigroups_pybind11
1111
"""
1212

13-
import pkgconfig
13+
from ._version import version as __version__
1414

1515
from .detail.dot import _Dot as Dot
1616

@@ -48,8 +48,6 @@
4848
"https://github.com/libsemigroups/libsemigroups_pybind11)"
4949
)
5050

51-
assert pkgconfig.exists("libsemigroups")
52-
5351
try:
5452
from _libsemigroups_pybind11 import ( # pylint: disable=no-name-in-module
5553
AhoCorasick,

0 commit comments

Comments
 (0)