How to reference to the top-level module in Python inside a package?

This should do the job: top_package = __import__(__name__.split(‘.’)[0]) The trick here is that for every module the __name__ variable contains the full path to the module separated by dots such as, for example, top_package.level_one_a.my_lib. Hence, if you want to get the top package name, you just need to get the first component of the path … Read more

flutter packages get failed depends on flutter_test any from sdk which requires SDK version

I was having a similar issue: Running “flutter packages get” in austin-feeds-me-flutter… The current Dart SDK version is 2.0.0-dev.58.0.flutter-f981f09760. Because austin_feeds_me depends on palette_generator any which requires SDK version >=2.0.0-dev.61.0 <3.0.0, version solving failed. pub get failed (1) Process finished with exit code 1 I fixed it with the following commands: flutter channel dev flutter … Read more

Distributing multiple packages using setup.py for Python

I may have answered my own question: If I modify the setup.py to use: packages = find_packages(), and change the directory structure to: … |-package1 | |-setup.py | |-MANIFEST.in | |-com (symlink to ../com) | |-utilities (symlink to ../utilities) | |-package1 | | |-__init__.py | | |-package1_1.py | | |-package1_2.py | | |-… If I … Read more