]> git.ipfire.org Git - pakfire.git/commitdiff
python: Drop the native Python code and move the C module
authorMichael Tremer <michael.tremer@ipfire.org>
Sat, 12 Oct 2024 17:23:52 +0000 (17:23 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Sat, 12 Oct 2024 17:23:52 +0000 (17:23 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
34 files changed:
Makefile.am
configure.ac
src/pakfire/__init__.py [deleted file]
src/pakfire/__version__.py.in [deleted file]
src/pakfire/config.py [deleted file]
src/pakfire/constants.py [deleted file]
src/pakfire/errors.py [deleted file]
src/pakfire/i18n.py [deleted file]
src/pakfire/logger.py [deleted file]
src/pakfire/util.py [deleted file]
src/python/archive.c [moved from src/_pakfire/archive.c with 100% similarity]
src/python/archive.h [moved from src/_pakfire/archive.h with 100% similarity]
src/python/archive_file.c [moved from src/_pakfire/archive_file.c with 100% similarity]
src/python/archive_file.h [moved from src/_pakfire/archive_file.h with 100% similarity]
src/python/ctx.c [moved from src/_pakfire/ctx.c with 100% similarity]
src/python/ctx.h [moved from src/_pakfire/ctx.h with 100% similarity]
src/python/errors.h [moved from src/_pakfire/errors.h with 100% similarity]
src/python/file.c [moved from src/_pakfire/file.c with 100% similarity]
src/python/file.h [moved from src/_pakfire/file.h with 100% similarity]
src/python/key.c [moved from src/_pakfire/key.c with 100% similarity]
src/python/key.h [moved from src/_pakfire/key.h with 100% similarity]
src/python/package.c [moved from src/_pakfire/package.c with 100% similarity]
src/python/package.h [moved from src/_pakfire/package.h with 100% similarity]
src/python/pakfire.c [moved from src/_pakfire/pakfire.c with 100% similarity]
src/python/pakfire.h [moved from src/_pakfire/pakfire.h with 100% similarity]
src/python/pakfiremodule.c [moved from src/_pakfire/_pakfiremodule.c with 89% similarity]
src/python/problem.c [moved from src/_pakfire/problem.c with 100% similarity]
src/python/problem.h [moved from src/_pakfire/problem.h with 100% similarity]
src/python/repo.c [moved from src/_pakfire/repo.c with 100% similarity]
src/python/repo.h [moved from src/_pakfire/repo.h with 100% similarity]
src/python/solution.c [moved from src/_pakfire/solution.c with 100% similarity]
src/python/solution.h [moved from src/_pakfire/solution.h with 100% similarity]
src/python/util.c [moved from src/_pakfire/util.c with 100% similarity]
src/python/util.h [moved from src/_pakfire/util.h with 100% similarity]

index b43c3b0ca86f83871f6ed3ba8b51ce26e4dce02b..1a660dfcb961300b94644d0f3aa85359b848b490 100644 (file)
@@ -102,66 +102,53 @@ dist_doc_DATA = \
 
 # ------------------------------------------------------------------------------
 
-pakfire_PYTHON = \
-       src/pakfire/__init__.py \
-       src/pakfire/__version__.py \
-       src/pakfire/config.py \
-       src/pakfire/constants.py \
-       src/pakfire/errors.py \
-       src/pakfire/i18n.py \
-       src/pakfire/logger.py \
-       src/pakfire/util.py
-
-pakfiredir = $(pythondir)/pakfire
-
-# ------------------------------------------------------------------------------
-
 pkgpyexec_LTLIBRARIES += \
-       _pakfire.la
-
-_pakfire_la_SOURCES = \
-       src/_pakfire/_pakfiremodule.c \
-       src/_pakfire/archive.c \
-       src/_pakfire/archive.h \
-       src/_pakfire/archive_file.c \
-       src/_pakfire/archive_file.h \
-       src/_pakfire/ctx.c \
-       src/_pakfire/ctx.h \
-       src/_pakfire/errors.h \
-       src/_pakfire/file.c \
-       src/_pakfire/file.h \
-       src/_pakfire/key.c \
-       src/_pakfire/key.h \
-       src/_pakfire/package.c \
-       src/_pakfire/package.h \
-       src/_pakfire/pakfire.c \
-       src/_pakfire/pakfire.h \
-       src/_pakfire/problem.c \
-       src/_pakfire/problem.h \
-       src/_pakfire/repo.c \
-       src/_pakfire/repo.h \
-       src/_pakfire/solution.c \
-       src/_pakfire/solution.h \
-       src/_pakfire/util.c \
-       src/_pakfire/util.h
-
-_pakfire_la_CPPFLAGS = \
+       pakfire.la
+
+pakfire_la_SOURCES = \
+       src/python/pakfiremodule.c \
+       src/python/archive.c \
+       src/python/archive.h \
+       src/python/archive_file.c \
+       src/python/archive_file.h \
+       src/python/ctx.c \
+       src/python/ctx.h \
+       src/python/errors.h \
+       src/python/file.c \
+       src/python/file.h \
+       src/python/key.c \
+       src/python/key.h \
+       src/python/package.c \
+       src/python/package.h \
+       src/python/pakfire.c \
+       src/python/pakfire.h \
+       src/python/problem.c \
+       src/python/problem.h \
+       src/python/repo.c \
+       src/python/repo.h \
+       src/python/solution.c \
+       src/python/solution.h \
+       src/python/util.c \
+       src/python/util.h
+
+pakfire_la_CPPFLAGS = \
        -include $(top_builddir)/config.h \
        $(PAKFIRE_CPPFLAGS)
 
-_pakfire_la_CFLAGS = \
+pakfire_la_CFLAGS = \
        $(AM_CFLAGS) \
        $(PYTHON_DEVEL_CFLAGS) \
-       $(JSON_C_CFLAGS) \
-       -Wno-cast-function-type
+       -Wno-cast-function-type \
+       -Wno-redundant-decls \
+       -Wno-strict-aliasing
 
-_pakfire_la_LDFLAGS = \
+pakfire_la_LDFLAGS = \
        $(AM_LDFLAGS) \
        -shared \
        -module \
        -avoid-version
 
-_pakfire_la_LIBADD = \
+pakfire_la_LIBADD = \
        $(PYTHON_DEVEL_LIBS) \
        $(PAKFIRE_LIBS)
 
@@ -1129,7 +1116,7 @@ TESTS_ENVIRONMENT += \
 
 # Test the Python modules we just built
 TESTS_ENVIRONMENT += \
-       PYTHONPATH=$(top_srcdir)/src:$(top_srcdir)/.libs:$(PYTHONPATH)
+       PYTHONPATH=$(top_srcdir)/.libs:$(PYTHONPATH)
 
 dist_check_SCRIPTS = \
        tests/python/archive.py \
index 192acb8553d54b90ef4dd2fa5cf53affe8ff2dde..8ac5aa597693554381d9ff10a34daa0dd04f08a3 100644 (file)
@@ -340,7 +340,6 @@ AC_DEFINE_UNQUOTED([PAKFIRE_TMP_DIR], ["/var/tmp"],
 AC_CONFIG_FILES([
        Makefile
        po/Makefile.in
-       src/pakfire/__version__.py
 ])
 
 AC_OUTPUT
diff --git a/src/pakfire/__init__.py b/src/pakfire/__init__.py
deleted file mode 100644 (file)
index 92264a7..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/usr/bin/python3
-###############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2011 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-# Import version
-from .__version__ import PAKFIRE_VERSION as __version__
-
-# Import everything from the C module
-try:
-       from ._pakfire import *
-except ImportError:
-       from _pakfire import *
diff --git a/src/pakfire/__version__.py.in b/src/pakfire/__version__.py.in
deleted file mode 100644 (file)
index 90bf0ca..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-# this file is autogenerated by the buildsystem
-PAKFIRE_VERSION = "@PACKAGE_VERSION@"
diff --git a/src/pakfire/config.py b/src/pakfire/config.py
deleted file mode 100644 (file)
index 912e166..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-#!/usr/bin/python3
-###############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2011 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-import configparser
-import logging
-import os
-
-log = logging.getLogger("pakfire.config")
-log.propagate = 1
-
-from .constants import *
-
-class Config(object):
-       def __init__(self, *files):
-               self._config = configparser.ConfigParser(
-                       interpolation=configparser.ExtendedInterpolation()
-               )
-
-               # Read any passed configuration files
-               for f in files:
-                       self.read(f)
-
-       def read(self, path):
-               """
-                       Reads configuration from the given file
-               """
-               if not path.startswith("/"):
-                       path = os.path.join(CONFIG_DIR, path)
-
-               # Silently return if nothing is found
-               if not os.path.exists(path):
-                       return
-
-               log.debug("Reading configuration from %s" % path)
-
-               with open(path) as f:
-                       self._config.read_file(f)
-
-       def parse(self, s):
-               """
-                       Takes configuration as a string and parses it
-               """
-               self._config.read_string(s)
-
-       def get(self, section, option=None, default=None):
-               if option is None:
-                       try:
-                               section = self._config.items(section)
-                       except configparser.NoSectionError:
-                               return default
-
-                       return dict(section)
-
-               return self._config.get(section, option, fallback=default)
-
-       def get_bool(self, section, option, default=None):
-               return self._config.getboolean(section, option, fallback=default)
diff --git a/src/pakfire/constants.py b/src/pakfire/constants.py
deleted file mode 100644 (file)
index b3b3dc3..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-#!/usr/bin/python3
-###############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2011 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-import os.path
-
-from .errors import *
-
-from .__version__ import PAKFIRE_VERSION
-
-# The default hub to connect to.
-PAKFIRE_HUB = "https://pakfire.ipfire.org/"
-
-SYSCONFDIR = "/etc"
-
-CONFIG_DIR = os.path.join(SYSCONFDIR, "pakfire")
-CONFIG_DISTRO_DIR = os.path.join(CONFIG_DIR, "distros")
-
-PACKAGE_EXTENSION = "pfm"
-MAKEFILE_EXTENSION = "nm"
diff --git a/src/pakfire/errors.py b/src/pakfire/errors.py
deleted file mode 100644 (file)
index 3ec0ba2..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/usr/bin/python3
-###############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2011 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-from .i18n import _
-
-from ._pakfire import (
-       CommandExecutionError,
-       DependencyError,
-)
-
-class Error(Exception):
-       exit_code = 1
-
-       message = _("An unhandled error occured.")
-
-
-class BuildError(Error):
-       pass
-
-
-class DownloadError(Error):
-       message = _("An error occured when pakfire tried to download files.")
-
-
-class TransportError(Error):
-       pass
-
-
-class TransportMaxTriesExceededError(TransportError):
-       pass
diff --git a/src/pakfire/i18n.py b/src/pakfire/i18n.py
deleted file mode 100644 (file)
index 75e7811..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/python3
-###############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2011 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-"""
-       The translation process of all strings is done in here.
-"""
-
-import  gettext
-
-"""
-       A function that returnes the same string.
-"""
-N_ = lambda x: x
-
-def _(singular, plural=None, n=None):
-       """
-               A function that returnes the translation of a string if available.
-
-               The language is taken from the system environment.
-       """
-       if not plural is None:
-               assert n is not None
-               return gettext.dngettext("pakfire", singular, plural, n)
-
-       return gettext.dgettext("pakfire", singular)
diff --git a/src/pakfire/logger.py b/src/pakfire/logger.py
deleted file mode 100644 (file)
index c20b077..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/python3
-###############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2011 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-import logging
-import sys
-import systemd.journal
-import time
-
-def setup(name, syslog_identifier="pakfire", enable_console=True, debug=False):
-       level = logging.INFO
-
-       # Enable debug logging
-       if debug:
-               level = logging.DEBUG
-
-       log = logging.getLogger(name)
-       log.setLevel(level)
-
-       # Do not propagate anything
-       log.propagate = False
-
-       # Clear any previous handlers
-       log.handlers.clear()
-
-       # Enable console output
-       if enable_console:
-               console = ConsoleHandler()
-               log.addHandler(console)
-
-               # Do not send any debug output to the console
-               console.setLevel(logging.INFO)
-
-       # Enable logging to journald
-       journal = systemd.journal.JournalHandler(
-               SYSLOG_IDENTIFIER=syslog_identifier,
-       )
-       log.addHandler(journal)
-
-       return log
-
-class BuildFormatter(logging.Formatter):
-       def __init__(self):
-               self._fmt = "[%(asctime)s] %(message)s"
-               self.datefmt = None
-
-               self.starttime = time.time()
-
-       def converter(self, recordtime):
-               """
-                       This returns a timestamp relatively to the time when we started
-                       the build.
-               """
-               recordtime -= self.starttime
-
-               return time.gmtime(recordtime)
-
-       def formatTime(self, record, datefmt=None):
-               ct = self.converter(record.created)
-               t = time.strftime("%H:%M:%S", ct)
-               s = "%s,%03d" % (t, record.msecs)
-               return s
-
-
-class ConsoleHandler(logging.Handler):
-       """
-               This simply writes everything to the console it receives.
-       """
-       def emit(self, record):
-               try:
-                       msg = self.format(record)
-
-                       # Append newline if necessary
-                       if not msg.endswith("\n"):
-                               msg = "%s\n" % msg
-
-                       # Select output file
-                       if record.levelno == logging.DEBUG or record.levelno >= logging.ERROR:
-                               fd = sys.stderr
-                       else:
-                               fd = sys.stdout
-
-                       # Write the output
-                       fd.write(msg)
-
-                       # Immediately flush
-                       self.flush()
-               except Exception:
-                       self.handleError(record)
-
-       def flush(self):
-               sys.stdout.flush()
-               sys.stderr.flush()
diff --git a/src/pakfire/util.py b/src/pakfire/util.py
deleted file mode 100644 (file)
index 7a2c9b6..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-#!/usr/bin/python3
-###############################################################################
-#                                                                             #
-# Pakfire - The IPFire package management system                              #
-# Copyright (C) 2011 Pakfire development team                                 #
-#                                                                             #
-# This program is free software: you can redistribute it and/or modify        #
-# it under the terms of the GNU General Public License as published by        #
-# the Free Software Foundation, either version 3 of the License, or           #
-# (at your option) any later version.                                         #
-#                                                                             #
-# This program is distributed in the hope that it will be useful,             #
-# but WITHOUT ANY WARRANTY; without even the implied warranty of              #
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               #
-# GNU General Public License for more details.                                #
-#                                                                             #
-# You should have received a copy of the GNU General Public License           #
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.       #
-#                                                                             #
-###############################################################################
-
-import platform
-
-def get_distro_name():
-       """
-               Returns the distro name of the host
-       """
-       try:
-               release = platform.freedesktop_os_release()
-       except AttributeError:
-               release = _read_os_release()
-
-       return release.get("PRETTY_NAME") or release.get("NAME")
-
-def _read_os_release():
-       """
-               This is a simple implementation to read /etc/os-release and /var/lib/os-release
-       """
-       for file in ("/etc/os-release", "/var/lib/os-release"):
-               try:
-                       with open(file, "r") as f:
-                               release = {}
-
-                               for line in f:
-                                       key, delim, value = line.partition("=")
-
-                                       release[key] = value
-
-                               return release
-               except FileNotFoundError:
-                       pass
-
-               raise OSError("Could not find os-release")
similarity index 100%
rename from src/_pakfire/archive.c
rename to src/python/archive.c
similarity index 100%
rename from src/_pakfire/archive.h
rename to src/python/archive.h
similarity index 100%
rename from src/_pakfire/ctx.c
rename to src/python/ctx.c
similarity index 100%
rename from src/_pakfire/ctx.h
rename to src/python/ctx.h
similarity index 100%
rename from src/_pakfire/errors.h
rename to src/python/errors.h
similarity index 100%
rename from src/_pakfire/file.c
rename to src/python/file.c
similarity index 100%
rename from src/_pakfire/file.h
rename to src/python/file.h
similarity index 100%
rename from src/_pakfire/key.c
rename to src/python/key.c
similarity index 100%
rename from src/_pakfire/key.h
rename to src/python/key.h
similarity index 100%
rename from src/_pakfire/package.c
rename to src/python/package.c
similarity index 100%
rename from src/_pakfire/package.h
rename to src/python/package.h
similarity index 100%
rename from src/_pakfire/pakfire.c
rename to src/python/pakfire.c
similarity index 100%
rename from src/_pakfire/pakfire.h
rename to src/python/pakfire.h
similarity index 89%
rename from src/_pakfire/_pakfiremodule.c
rename to src/python/pakfiremodule.c
index 69421588bfc31a3df1bf94c5831e5530b7ee0134..2213fff8da6e78acae24300ad813d331818fa072 100644 (file)
@@ -39,7 +39,7 @@
 #include "solution.h"
 #include "util.h"
 
-PyMODINIT_FUNC PyInit__pakfire(void);
+PyMODINIT_FUNC PyInit_pakfire(void);
 
 PyObject* PyExc_BadSignatureError;
 PyObject* PyExc_CommandExecutionError;
@@ -48,7 +48,7 @@ PyObject* PyExc_DependencyError;
 PyObject* PyExc_CheckError;
 PyObject* PyExc_CheckFileVerificationError;
 
-static PyObject* _pakfire_supported_arches(void) {
+static PyObject* Pakfire_supported_arches(void) {
        int r;
 
        // Fetch all architectures
@@ -86,7 +86,7 @@ ERROR:
        return NULL;
 }
 
-static PyObject* _pakfire_version_compare(PyObject* self, PyObject* args) {
+static PyObject* Pakfire_version_compare(PyObject* self, PyObject* args) {
        const char* evr1 = NULL;
        const char* evr2 = NULL;
        int r;
@@ -102,10 +102,10 @@ static PyObject* _pakfire_version_compare(PyObject* self, PyObject* args) {
 }
 
 static PyMethodDef pakfireModuleMethods[] = {
-       {"supported_arches", (PyCFunction)_pakfire_supported_arches, METH_NOARGS, NULL },
+       {"supported_arches", (PyCFunction)Pakfire_supported_arches, METH_NOARGS, NULL },
        {
                "version_compare",
-               (PyCFunction)_pakfire_version_compare,
+               (PyCFunction)Pakfire_version_compare,
                METH_VARARGS,
                NULL,
        },
@@ -114,14 +114,12 @@ static PyMethodDef pakfireModuleMethods[] = {
 
 static struct PyModuleDef moduledef = {
        .m_base = PyModuleDef_HEAD_INIT,
-       .m_name = "_pakfire",
+       .m_name = "pakfire",
        .m_size = -1,
        .m_methods = pakfireModuleMethods,
 };
 
-PyMODINIT_FUNC PyInit__pakfire(void) {
-       int r;
-
+PyMODINIT_FUNC PyInit_pakfire(void) {
        /* Initialize locale */
        setlocale(LC_ALL, "");
        bindtextdomain(PACKAGE_TARNAME, "/usr/share/locale");
@@ -132,22 +130,22 @@ PyMODINIT_FUNC PyInit__pakfire(void) {
        if (!module)
                return NULL;
 
-       PyExc_BadSignatureError = PyErr_NewException("_pakfire.BadSignatureError", NULL, NULL);
+       PyExc_BadSignatureError = PyErr_NewException("pakfire.BadSignatureError", NULL, NULL);
        Py_INCREF(PyExc_BadSignatureError);
        PyModule_AddObject(module, "BadSignatureError", PyExc_BadSignatureError);
 
-       PyExc_CommandExecutionError = PyErr_NewException("_pakfire.CommandExecutionError", NULL, NULL);
+       PyExc_CommandExecutionError = PyErr_NewException("pakfire.CommandExecutionError", NULL, NULL);
        Py_INCREF(PyExc_CommandExecutionError);
        PyModule_AddObject(module, "CommandExecutionError", PyExc_CommandExecutionError);
 
-       PyExc_DependencyError = PyErr_NewException("_pakfire.DependencyError", NULL, NULL);
+       PyExc_DependencyError = PyErr_NewException("pakfire.DependencyError", NULL, NULL);
        Py_INCREF(PyExc_DependencyError);
        PyModule_AddObject(module, "DependencyError", PyExc_DependencyError);
 
        // Check Exceptions
 
        // CheckError
-       PyExc_CheckError = PyErr_NewException("_pakfire.CheckError", NULL, NULL);
+       PyExc_CheckError = PyErr_NewException("pakfire.CheckError", NULL, NULL);
        Py_INCREF(PyExc_CheckError);
        if (PyModule_AddObject(module, "CheckError", PyExc_CheckError) < 0) {
                Py_XDECREF(PyExc_CheckError);
@@ -157,7 +155,7 @@ PyMODINIT_FUNC PyInit__pakfire(void) {
 
        // CheckFileVerificationError based on CheckError
        PyExc_CheckFileVerificationError = PyErr_NewExceptionWithDoc(
-               "_pakfire.CheckFileVerificationError",
+               "pakfire.CheckFileVerificationError",
                "The file verification process failed",
                PyExc_CheckError,
                NULL
similarity index 100%
rename from src/_pakfire/problem.c
rename to src/python/problem.c
similarity index 100%
rename from src/_pakfire/problem.h
rename to src/python/problem.h
similarity index 100%
rename from src/_pakfire/repo.c
rename to src/python/repo.c
similarity index 100%
rename from src/_pakfire/repo.h
rename to src/python/repo.h
similarity index 100%
rename from src/_pakfire/util.c
rename to src/python/util.c
similarity index 100%
rename from src/_pakfire/util.h
rename to src/python/util.h