def test_project_flit_setup(temporary_dir): with open(os.path.join(temporary_dir, "pyproject.toml"), "w") as setup_file: setup_file.write(FAKE_PYPROJECT_TOML_FLIT) project_config = config.project(directory=temporary_dir, config_file="pyproject.toml") assert project_config["modules"] == ["preconvert"]
def project_configuration(directory: str = "", config_file: str = "pyproject.toml") -> dict: """Returns the configuration associated with a project. - *directory*: The root folder of your project. - *config_file*: The [TOML](https://github.com/toml-lang/toml#toml) formatted config file you wish to use. """ directory = directory if directory else os.getcwd() return config.project(directory=directory, config_file=config_file)
def project_configuration( directory: str = "", config_file: str = "pyproject.toml", modules: list = None ) -> dict: """Returns the configuration associated with a project. - *directory*: The root folder of your project. - *config_file*: The [TOML](https://github.com/toml-lang/toml#toml) formatted config file you wish to use. - *modules*: One or more modules to include in the configuration for reference rendering """ overrides = {} if modules: overrides["modules"] = modules directory = directory if directory else os.getcwd() return config.project(directory=directory, config_file=config_file, **overrides)
def test_project_setup_py(temporary_dir): with open(os.path.join(temporary_dir, "setup.py"), "w") as setup_file: setup_file.write(FAKE_SETUP_FILE) project_config = config.project(directory=temporary_dir, config_file="") assert project_config["modules"] == ["fake"]