What is the difference between an ‘sdist’ .tar.gz distribution and an python egg?

setup.py sdist creates a source distribution: it contains setup.py, the source files of your module/script (.py files or .c/.cpp for binary modules), your data files, etc. The result is an archive that can then be used to recompile everything on any platform. setup.py bdist (and bdist_*) creates a built distribution: it includes .pyc files, .so/.dll/.dylib … Read more

Python packages and egg-info directories

The .egg-info directories get only created if –single-version-externally-managed was used to install the egg. “Normally”, installing an egg would create a single directory (or zip file), containing both the code and the metadata. pkg_resources (which is the library that reads the metadata) has a function require which can be used to request a specific version … Read more

How to create Python egg file

You are reading the wrong documentation. You want this: https://setuptools.readthedocs.io/en/latest/setuptools.html#develop-deploy-the-project-source-in-development-mode Creating setup.py is covered in the distutils documentation in Python’s standard library documentation here. The main difference (for python eggs) is you import setup from setuptools, not distutils. Yep. That should be right. I don’t think so. pyc files can be version and platform dependent. … Read more

Most Pythonic way to provide global configuration variables in config.py? [closed]

How about just using the built-in types like this: config = { “mysql”: { “user”: “root”, “pass”: “secret”, “tables”: { “users”: “tb_users” } # etc } } You’d access the values as follows: config[“mysql”][“tables”][“users”] If you are willing to sacrifice the potential to compute expressions inside your config tree, you could use YAML and end … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)