Skip to content

Commit

Permalink
Affected Issue(s): Fixes when try to run within Windows OS environment (
Browse files Browse the repository at this point in the history
#268)

* Affected Issue(s): Fixes when try to run within Windows OS environment

Resolves sid-indonesia/it-team#313

What this commit has achieved:
1. Renamed an entry in `.env` from `username` to `user_name` to accomodate usage within Windows OS (there is a default OS env var %username% within Windows OS)
2. Added `python-magic-bin` to the `requirements.txt`, to resolve issue of:
```
ImportError: failed to find libmagic.  Check your installation
```
(Possibly only happens in Windows OS, not really sure)

* Affected Issue(s): Small fix on `requirements.txt`

Resolves sid-indonesia/it-team#313

What this commit has achieved:
1. Only add `python-magic-bin` as one of the requirements if the `sys_platform` is Windows.

* Affected Issue(s): Fixed tests env

Resolves sid-indonesia/it-team#313

What this commit has achieved:
1. Renamed env var `username` to `user_name` in `pytest.ini`.
2. Corrected the order of default values in the `README.md` of `importer`.
  • Loading branch information
muhammad-levi authored Aug 23, 2024
1 parent 5a78668 commit 11b7fc3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions importer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ product_access_token = 'example-product-access-token'
# if using resource owner credentials (i.e importer handles getting authentication by itself)
# This has greater precedence over the access and refresh tokens if supplied
username = 'example-username'
user_name = 'example-user_name'
password = 'example-password'
# if embedding importer into a service that already does the authentication
Expand Down Expand Up @@ -107,7 +107,7 @@ The coverage report `coverage.html` will be at the working directory
- Run `python3 main.py --csv_file csv/organizations/organizations_min.csv --resource_type organizations --log_level info`
- See example csv [here](/importer/csv/organizations/organizations_min.csv)
- The first column __name__ is the only one required
- If the csv file has only the required column, (e.g. [organizations_min.csv](/importer/csv/organizations/organizations_min.csv)) the __id__ , __active__, and __method__ are set to __generating a new unique_uuid__ and the default values __create__ and __true__ respectively
- If the csv file has only the required column, (e.g. [organizations_min.csv](/importer/csv/organizations/organizations_min.csv)) the __id__ , __active__, and __method__ are set to __generating a new unique_uuid__ and the default values __true__ and __create__ respectively
- [organizations_full](/importer/csv/organizations/organizations_full.csv) shows more options available
- The third column is the request method, can be either create or update. Default is set to create
- The fourth column is the id, which is required when updating
Expand Down
2 changes: 1 addition & 1 deletion importer/importer/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

product_access_token = os.getenv("product_access_token")

username = os.getenv("username")
username = os.getenv("user_name")
password = os.getenv("password")

access_token = os.getenv("access_token")
Expand Down
2 changes: 1 addition & 1 deletion importer/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ env =
fhir_base_url = 'https://example.smartregister.org/fhir'
keycloak_url = 'https://keycloak.smartregister.org/auth'
realm = 'realm'
username = 'example-username'
user_name = 'example-username'
password = 'example-password'
2 changes: 2 additions & 0 deletions importer/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ python-magic==0.4.27
jwt
python-dotenv==1.0.1
pytest-env==1.1.3
# Windows requirements
python-magic-bin==0.4.14; sys_platform == 'win32'

0 comments on commit 11b7fc3

Please sign in to comment.