Repository: matze/pkgconfig (language: python)

Issue:
use src/ project layout?
for quite some reasons it is preferable not to have the main package directory in `./pkgconfig`, but rather in `src/pkgconfig`, e.g. making sure the actually installed code is tested and not accidentally the package that happens to be in `.`.



Discussion / hints:
i could contribute this after next release, if wanted.
@matze Any comment?
Yeah, please go ahead with a PR, I have no objections!
OK, will do after #70 is merged, so we have working CI first.


Fix patch:
diff --git a/pkgconfig/__init__.py b/src/pkgconfig/__init__.py
similarity index 100%
rename from pkgconfig/__init__.py
rename to src/pkgconfig/__init__.py
diff --git a/pkgconfig/pkgconfig.py b/src/pkgconfig/pkgconfig.py
similarity index 100%
rename from pkgconfig/pkgconfig.py
rename to src/pkgconfig/pkgconfig.py


Test patch:
diff --git a/data/fake-dld-pkg.pc b/tests/data/fake-dld-pkg.pc
similarity index 100%
rename from data/fake-dld-pkg.pc
rename to tests/data/fake-dld-pkg.pc
diff --git a/data/fake-gtk+-3.0.pc b/tests/data/fake-gtk+-3.0.pc
similarity index 100%
rename from data/fake-gtk+-3.0.pc
rename to tests/data/fake-gtk+-3.0.pc
diff --git a/data/fake-ldonly-pkg.pc b/tests/data/fake-ldonly-pkg.pc
similarity index 100%
rename from data/fake-ldonly-pkg.pc
rename to tests/data/fake-ldonly-pkg.pc
diff --git a/data/fake-openssl.pc b/tests/data/fake-openssl.pc
similarity index 100%
rename from data/fake-openssl.pc
rename to tests/data/fake-openssl.pc
diff --git a/data/fake-python.pc b/tests/data/fake-python.pc
similarity index 100%
rename from data/fake-python.pc
rename to tests/data/fake-python.pc
diff --git a/test_pkgconfig.py b/tests/test_pkgconfig.py
similarity index 96%
rename from test_pkgconfig.py
rename to tests/test_pkgconfig.py
index 7f7a9ff..10a1b3a 100644
--- a/test_pkgconfig.py
+++ b/tests/test_pkgconfig.py
@@ -3,7 +3,8 @@
 import pytest
 import pkgconfig
 
-os.environ['PKG_CONFIG_PATH'] = os.path.abspath('./data')
+this_dir = os.path.dirname(__file__)
+os.environ['PKG_CONFIG_PATH'] = os.path.abspath(os.path.join(this_dir, 'data'))
 PACKAGE_NAME = 'fake-gtk+-3.0'
 
 
@@ -139,7 +140,7 @@ def test_configure_extension():
     ext = Extension('foo', ['foo.c'])
     pkgconfig.configure_extension(ext, 'fake-gtk+-3.0 fake-python')
     assert sorted(ext.extra_compile_args) == [
-         '-DGSEAL_ENABLE', '-I/usr/include/gtk-3.0','-I/usr/include/python2.7']
+         '-DGSEAL_ENABLE', '-I/usr/include/gtk-3.0', '-I/usr/include/python2.7']
     assert sorted(ext.extra_link_args) == [
         '-L/usr/lib_gtk_foo', '-L/usr/lib_python_foo', '-lgtk-3', '-lpython2.7']