I have created a python package with several files and directories out of which only one particular module requires a library (PyQt) with GPL license. Since GPL license of the used library puts a restriction on the program to have same license. I was wondering if I can have separate license for other files of the package?
The GPL license on the library does not strictly imply that you must use the GPL license on the program. The GPL license requires that the rights that users get under the GPL license are extended to all code in the application, but that can also be achieved by using a GPL-compatible open-source license.
Additionally, the GPL license requires that you inform recipients that the terms of the GPL apply.
As long as you inform the recipients of your program that the GPL terms apply due to and as long as there is a dependency on PyQt, you can use a dual license (with one of the licenses being GPL compatible), or even a single GPL-compatible license for your own code.
A GPL-licensed library requires that any programme making use of it is also distributed under the GPL. However a GPL-licensed programme does not require that all libraries (or modules) it uses are also GPL-licensed. The modules can be under GPL or other licenses which are more permissive (like BSD, Apache, LGPL etc).