Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated MainConfig.py to work in a Win32 context #645

Merged

Conversation

phreed
Copy link
Contributor

@phreed phreed commented Nov 29, 2023

Issues to discuss:

Use of platformdirs

platformdirs makes some decisions that differ from those in the MainConfig.py.
https://platformdirs.readthedocs.io/en/latest/

Use of sysconfig

sysconfig can be used to identify the site-packages (or equivalent).
The use of MAIN_PATH = Path(sysconfig.get_path('purelib')) may be more reliable;
than, searching based on knowing the location of __file__.

Using python Paths rather than strings

The main place where this is done is MainConfig.py.
From where does the source for config.py come?

The function prototype does not match the call

FreeTAKServer/services/rest_api_service/rest_api_service_main.py calls a constructor ComponentTest
whose arguments do not match the calls.

@brothercorvo brothercorvo merged commit ecdfe06 into FreeTAKTeam:ImplementMission Nov 29, 2023
@naman108
Copy link
Collaborator

naman108 commented Dec 4, 2023

This shouldn't have been merged at that time, we appreciate the contribution however we'll need to revert the change in 2.1 temporarily. Could you open a new pull against FTS_2.1 once you've fixed the following behavior @phreed ?

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/controllers/services/FTS.py", line 1, in <module>
    from FreeTAKServer.core.persistence.DatabaseController import (
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/persistence/DatabaseController.py", line 11, in <module>
    from FreeTAKServer.core.configuration.DatabaseConfiguration import DatabaseConfiguration
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/configuration/DatabaseConfiguration.py", line 4, in <module>
    config = MainConfig.instance()
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/configuration/MainConfig.py", line 402, in instance
    cls._instance.read_yaml_config(config_file)
  File "/usr/local/lib/python3.11/dist-packages/FreeTAKServer/core/configuration/MainConfig.py", line 442, in read_yaml_config
    if sect in yamlConfig:
       ^^^^^^^^^^^^^^^^^^
TypeError: argument of type 'NoneType' is not iterable

This is thrown when trying to execute a new FTS installation on our dev server.

It's also missing the platformdirs dependency in the pyprojec.toml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants