Skip to content

Commit

Permalink
ctypes: move directory out of python/grass (#1898)
Browse files Browse the repository at this point in the history
* move python/grass/ctypes directory out of python/grass and rename it

* reintroduce (now renamed) __init__ and compile ALL files (fixing regression caused by
ca2d28a)
  • Loading branch information
nilason committed Oct 6, 2021
1 parent 87398fa commit be35654
Show file tree
Hide file tree
Showing 49 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .flake8
Expand Up @@ -243,7 +243,7 @@ exclude =
# Test output directory
testreport,
# Not yet compliant
python/grass/ctypes,
python/libgrass_interface_generator,
# No tests checked for now
testsuite,

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Expand Up @@ -18,7 +18,7 @@ exclude = '''
| bin\..*
| dist\..*
)/
| python/grass/ctypes/
| python/libgrass_interface_generator/
# Bug in Black related to r-string prefix capitalization reformats
# a line in this file unnecessarily. File is however fully Black-formatted
# at the time of writing.
Expand Down
3 changes: 2 additions & 1 deletion python/Makefile
Expand Up @@ -3,7 +3,8 @@ MODULE_TOPDIR = ..
include $(MODULE_TOPDIR)/include/Make/Vars.make

SUBDIRS = \
grass
grass \
libgrass_interface_generator

include $(MODULE_TOPDIR)/include/Make/Dir.make

Expand Down
1 change: 0 additions & 1 deletion python/grass/Makefile
Expand Up @@ -9,7 +9,6 @@ SUBDIRS = \
app \
bandref \
benchmark \
ctypes \
exceptions \
grassdb \
gunittest \
Expand Down
@@ -1,4 +1,4 @@
MODULE_TOPDIR = ../../..
MODULE_TOPDIR = ../..

PACKAGE = "grasslibs"

Expand Down Expand Up @@ -75,11 +75,11 @@ PYDIR = $(ETC)/python
GDIR = $(PYDIR)/grass
DSTDIR = $(GDIR)/lib

PYFILES := $(patsubst %,$(DSTDIR)/%.py,$(MODULES))
PYCFILES := $(patsubst %,$(DSTDIR)/%.pyc,$(MODULES))
PYFILES := $(patsubst %,$(DSTDIR)/%.py,$(MODULES) __init__ ctypes_preamble ctypes_loader)
PYCFILES := $(patsubst %,$(DSTDIR)/%.pyc,$(MODULES) __init__ ctypes_preamble ctypes_loader)
LPYFILES := $(patsubst %,$(OBJDIR)/%.py,$(MODULES))

COPY_FILES = $(DSTDIR)/ctypes_loader.py $(DSTDIR)/ctypes_preamble.py
COPY_FILES = $(DSTDIR)/ctypes_loader.py $(DSTDIR)/ctypes_preamble.py $(DSTDIR)/__init__.py

ifeq ($(strip $(GRASS_LIBRARY_TYPE)),shlib)
default: $(COPY_FILES)
Expand All @@ -96,6 +96,8 @@ $(DSTDIR)/ctypes_loader.py: ctypesgen/libraryloader.py
cp -f $< $@
$(DSTDIR)/ctypes_preamble.py: ctypesgen/printer_python/preamble/3_2.py
cp -f $< $@
$(DSTDIR)/__init__.py: libgrass__init__.py
cp -f $< $@

$(DSTDIR)/%.py: $(OBJDIR)/%.py | $(DSTDIR)
$(INSTALL_DATA) $< $@
Expand Down
Expand Up @@ -6,7 +6,7 @@ https://github.com/ctypesgen/ctypesgen/commit/0681f8ef1742206c171d44b7872c700f34

### How to update ctypesgen version

1. Replace the GRASS directory `python/grass/ctypes/ctypesgen` with the `ctypesgen`
1. Replace the GRASS directory `python/libgrass_interface_generator/ctypesgen` with the `ctypesgen`
directory from ctypesgen source directory.
2. Replace `python/grass/ctypes/run.py` with `run.py` from ctypesgen source directory.
3. Apply the patches below.
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit be35654

Please sign in to comment.