Location¶
Problematics¶
- How can we create a more efficient way to work with configuration?
- How can we make the configuration file(s) available globally so that PyFunceble can be run everywhere in the user workspace?
To answer those problematics, we moved the configuration location elsewhere in the place where most users expect to have their configuration file(s).
Filename-s¶
At any of the listed configuration location, the following file will be read:
.PyFunceble.yaml
This file is generated automatically if missing.
This file is automatically replaced if you choose to merge the upstream configuration when a features key is introduced or removed.
This “new” behavior was introduced at the same time .PyFunceble.overwrite.yaml was. This is to ensure PyFunceble at all time is running on a fully compatible version of .PyFunceble.yaml
.PyFunceble.overwrite.yaml
- This is the project specific configuration file for PyFunceble.
This file is now taking presedence over
.PyFunceble.yaml
which for sure previously was the file you used to alter for your pwn needs. - This file can only be maintained by a human-controlled process. PyFunceble will never write into and never owerwrite this file, once it is created.
- This is the project specific configuration file for PyFunceble.
This file is now taking presedence over
Repository clone¶
If you cloned the repository and you’re trying to test from a cloned
directory (the one with for example CONTRIBUTING.md
) we consider
the configuration directory as the current one.
Note
This behavior allows us to not modify the way we develop PyFunceble.
Travis CI¶
Under Travis CI, we search or initiate the configuration at the directory we are currently located.
Warning
We don’t care about the distribution, as long as the
TRAVIS_BUILD_DIR
environment variable is set, we search or
initiate the configuration in the current directory.
Note
If you want to force the directory where we should work, you can
initiate the PYFUNCEBLE_CONFIG_DIR
environment variable with
the path where we should work.
GitLab CI/CD¶
Under GitLab CI/CD, we search or initiate the configuration at the directory we are currently located.
Warning
We don’t care about the distribution, as long as the PROJECT_CI
and GITLAB_CI
environment variables are set, we search or
initiate the configuration in the current directory.
Note
If you want to force the directory where we should work, you can
initiate the PYFUNCEBLE_CONFIG_DIR
environment variable with
the path where we should work.
GitHub Actions¶
Under GitHub Actions, we search or initiate the configuration at the directory we are currently located.
Warning
We don’t care about the distribution, as long as the
GITHUB_ACTIONS
environment variable is set, we search or
initiate the configuration in the current directory.
Note
If you want to force the directory where we should work, you can
initiate the PYFUNCEBLE_CONFIG_DIR
environment variable with
the path where we should work.
Jenkins CI¶
Under Jenkins CI, we search or initiate the configuration at the directory we are currently located.
Warning
We don’t care about the distribution, as long as the
JENKINS_URL
and JENKINS_HOME
environment variables
are set, we search or initiate the configuration in the current
directory.
Note
If you want to force the directory where we should work, you can
initiate the PYFUNCEBLE_CONFIG_DIR
environment variable with
the path where we should work.
Linux and MacOS (Darwin Kernel)¶
Under Linux and MacOS, we look for the following directories in their order. If any configuration directory is found, the system proposes you to install them automatically on the first configuration file.
~/.config/PyFunceble
~/.PyFunceble
${PWD}
Note
If the parent directory does not exist, we move to the next possible location in the given order.
This means that under most Linux distributions and MacOS versions,
we consider ~/.config/PyFunceble
as the configuration
location.
But if the ~/.config
directory does not exist, we fallback
to ~/.PyFunceble
as the configuration location.
Windows¶
As mentioned by Pat Altimore’s Blog, we used the
Per user configuration files synchronized across domain joined
machines via Active Directory Roaming
section to understand what we
should do to find our configuration directory.
Under Windows, we look for the following directories in their order. If any configuration directory is found, the system proposes you to install them automatically on the first configuration file.
%APPDATA%\PyFunceble
(environnement variable)%CD%
Note
%CD%
is explained by the set command (set /?
):
%CD% - expands to the current directory string.
Note
If the parent directory does not exist, we move to the next possible location in the given order.
This means that under most Windows versions, we consider
%APPDATA%\PyFunceble
- also know as
C:\Users\userName\AppData\Roaming\PyFunceble
- as the
configuration location.
But if the %APPDATA%
directory does not exist, we fall back
to the current directory as the configuration location.
Custom location¶
Sometimes, you may find yourself in a position where you absolutely do not want PyFunceble to use its default configuration location.
For that reason, if you set your desired configuration location along
with the PYFUNCEBLE_CONFIG_DIR
environment variable, we take
that location as the (default) configuration location.