Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • fconil-small-programs/python/bases/import-resources-example
1 result
Show changes
Commits on Source (2)
*~
*.pyc
__pycache__
*.csv
......@@ -13,3 +13,27 @@ Packaging informations :
- https://packaging.python.org/en/latest/tutorials/packaging-projects/
- https://choosealicense.com/
## Troubleshooting
If we have untracked data files in the package tree, flist refuses to build the
package.
```shell
$ flit build
Fetching list of valid trove classifiers I-flit.validate
Untracked or deleted files in the source directory. Commit, undo or ignore these files in your VCS.
```
If we add a line to ignore, e.g. all csv files, in `.gitignore` we get a warning when we want to add one.
```shell
$ git add src/import-resources-example/data/WPP2022_TotalPopulationBySex.csv
Les chemins suivants sont ignorés par un de vos fichiers .gitignore :
src/import-resources-example/data/WPP2022_TotalPopulationBySex.csv
astuce: Utilisez -f si vous voulez vraiment les ajouter.
astuce: Éliminez ce message en lançant
astuce: "git config advice.addIgnoredFile false"
```
As we can append the data files with `-f`, I will ignore the data file in `.gitignore`.
......@@ -3,7 +3,7 @@ requires = ["flit_core>=3.2"]
build-backend = "flit_core.buildapi"
[project]
name = "import-resources-example"
name = "import_resources_example"
version = "0.0.1"
authors = [
{ name="Françoise CONIL", email="francoise.conil@cnrs.fr" },
......
......@@ -47,7 +47,7 @@ def get_oms_data():
"""
studies = []
with resources.open_text("example_package_import.data", "COVID19-web.27-07-2022.csv") as f:
with resources.open_text("import_resources_example.data", "COVID19-web.27-07-2022.csv") as f:
rows = csv.DictReader(f)
for row in rows:
......
......@@ -7,7 +7,7 @@ def extract_population_general_info():
locations = set()
with resources.open_text("example_package_import.data", "WPP2022_TotalPopulationBySex.csv") as f:
with resources.open_text("import_resources_example.data", "WPP2022_TotalPopulationBySex.csv") as f:
rows = csv.DictReader(f)
for row in rows:
......