pymox-tools 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ GH_TOKEN=ghp_XXXXXXXXXXXXXXXXXXXXXXXXXXXX
2
+ PYPI_TOKEN=pypi-XXXXXXXXXXXXXXXXXXXXXXXXXXXX
@@ -0,0 +1,57 @@
1
+ name: Semantic Release
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ # tags:
8
+ # - 'v*' # Pour ne publier PyPI que les tag numérotés faits à la main
9
+
10
+ jobs:
11
+ build-and-publish:
12
+ name: Run semantic-release
13
+ runs-on: ubuntu-latest
14
+
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v3
18
+ with:
19
+ fetch-depth: 0
20
+
21
+ - name: Set up Python
22
+ uses: actions/setup-python@v4
23
+ with:
24
+ python-version: "3.10"
25
+
26
+ - name: Install dependencies
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install python-semantic-release build twine setuptools_scm
30
+
31
+ - name: Run semantic-release
32
+ env:
33
+ GH_TOKEN: ${{ secrets.SEMANTIC_RELEASE }}
34
+ PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
35
+ run: |
36
+ semantic-release version
37
+ semantic-release publish
38
+
39
+ - name: Re-checkout after tagging
40
+ run: |
41
+ git fetch --tags
42
+ git checkout $(git describe --tags --abbrev=0)
43
+
44
+ - name: Clean dist folder
45
+ run: rm -rf dist/
46
+
47
+ - name: Build the package
48
+ # env:
49
+ # SETUPTOOLS_SCM_PRETEND_VERSION: ${{ steps.get_tag.outputs.tag }}
50
+ run: python -m build
51
+
52
+ - name: Publish to PyPI
53
+ # if: success() # ou if: steps.semantic-release.outcome == 'success'
54
+ env:
55
+ TWINE_USERNAME: __token__
56
+ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
57
+ run: twine upload dist/*
@@ -0,0 +1,32 @@
1
+ .env
2
+ # Byte-compiled / optimized / DLL files
3
+ **/__pycache__
4
+ **/.pytest_cache
5
+
6
+ # Jupyter Notebook
7
+ .ipynb_checkpoints
8
+
9
+ # virtual envs
10
+ **/.venv/
11
+
12
+ # GitHub
13
+ # **/.github/
14
+
15
+ # VSCode
16
+ **/.vscode/
17
+
18
+ # Coverage
19
+ **/.coverage
20
+
21
+ # truc bizarre
22
+ **/.DS_Store
23
+
24
+ # site construit
25
+ site/
26
+ _build/
27
+ dist/
28
+ src/*.egg-info/
29
+
30
+ pws.txt
31
+ src/gc7/_version.py
32
+ CHANGE.LOG
@@ -0,0 +1,86 @@
1
+ ---
2
+ description: Repository Information Overview
3
+ alwaysApply: true
4
+ ---
5
+
6
+ # GC7 Information
7
+
8
+ ## Summary
9
+ GC7 is a Python utility toolkit for PyMoX developers (PY-thon - MO-jo - Flet-X). The project is set up as a Python package that can be published to PyPI using semantic versioning. It uses GitHub Actions for automated releases and follows conventional commits for version management.
10
+
11
+ ## Structure
12
+ - **src/gc7/**: Main package source code
13
+ - **.github/workflows/**: CI/CD pipeline configurations
14
+ - **.venv/**: Python virtual environment
15
+ - **.zencoder/**: Configuration for Zencoder
16
+
17
+ ## Language & Runtime
18
+ **Language**: Python
19
+ **Version**: Python 3.10+
20
+ **Build System**: setuptools
21
+ **Package Manager**: pip
22
+
23
+ ## Dependencies
24
+ **Main Dependencies**:
25
+ - setuptools_scm: For version management
26
+ - python-dotenv: For environment variable loading
27
+
28
+ **Development Dependencies**:
29
+ - python-semantic-release: For automated versioning and releases
30
+ - build: For building Python packages
31
+ - twine: For publishing to PyPI
32
+
33
+ ## Build & Installation
34
+ ```bash
35
+ python -m venv .venv
36
+ .\.venv\Scripts\activate
37
+ pip install -r requirements.txt
38
+
39
+ # Build package
40
+ python -m build
41
+
42
+ # Check distribution
43
+ twine check dist/* --verbose
44
+
45
+ # Upload to PyPI
46
+ twine upload dist/* --verbose
47
+ ```
48
+
49
+ ## Version Management
50
+ **Tool**: python-semantic-release
51
+ **Configuration**: pyproject.toml
52
+ **Version Source**: Git tags
53
+ **Commands**:
54
+ ```bash
55
+ # Check if a new version would be generated
56
+ semantic-release --noop version
57
+
58
+ # Create a new version locally
59
+ semantic-release version --commit --tag --no-push
60
+
61
+ # Publish a new version
62
+ semantic-release publish
63
+ ```
64
+
65
+ ## CI/CD
66
+ **Platform**: GitHub Actions
67
+ **Workflow**: .github/workflows/publish.yml
68
+ **Trigger**: Push to main branch
69
+ **Process**:
70
+ 1. Checkout code
71
+ 2. Set up Python 3.10
72
+ 3. Install dependencies
73
+ 4. Run semantic-release to version and publish
74
+
75
+ ## Environment Variables
76
+ **Required**:
77
+ - GH_TOKEN: GitHub token for releases
78
+ - PYPI_TOKEN: PyPI token for package publishing
79
+
80
+ ## Project Configuration
81
+ **Package Structure**:
82
+ - Dynamic versioning using setuptools_scm
83
+ - Source code in src/gc7/
84
+ - Requires Python 3.10+
85
+ - Uses conventional commits for version management
86
+ - Current version: v1.1.9 (as of 2025-08-02)
@@ -0,0 +1,45 @@
1
+ # CHANGELOG
2
+
3
+ <!-- version list -->
4
+
5
+ ## v1.0.6 (2025-08-04)
6
+
7
+ ### Bug Fixes
8
+
9
+ - Try 1.0.6
10
+ ([`2738278`](https://github.com/PyMoX-fr/GC7/commit/2738278da8c7c33dac1ada54b33dafb04ca4a859))
11
+
12
+
13
+ ## v1.0.5 (2025-08-03)
14
+
15
+ ### Bug Fixes
16
+
17
+ - Try v5
18
+ ([`a3054f8`](https://github.com/PyMoX-fr/GC7/commit/a3054f8608157acf7cfb1c98af8b68bf646c44a8))
19
+
20
+
21
+ ## v1.0.4 (2025-08-03)
22
+
23
+ ### Bug Fixes
24
+
25
+ - Set local dev for tokens()
26
+ ([`3183e15`](https://github.com/PyMoX-fr/GC7/commit/3183e15b25687c51da31870827091a5e81f756ff))
27
+
28
+
29
+ ## v1.0.3 (2025-08-03)
30
+
31
+
32
+ ## v1.0.2 (2025-08-03)
33
+
34
+
35
+ ## v1.0.1 (2025-08-03)
36
+
37
+ ### Bug Fixes
38
+
39
+ - Set hello()
40
+ ([`03efc80`](https://github.com/PyMoX-fr/GC7/commit/03efc8032804e20feadba5fd246e07c1bc133b4b))
41
+
42
+
43
+ ## v1.0.0 (2025-08-03)
44
+
45
+ - Initial Release
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.4
2
+ Name: pymox_tools
3
+ Version: 0.0.0
4
+ Summary: Un module avec plein d'outils utiles pour devs en PyMoX (PY-thon - MO-jo - Flet-X)
5
+ Author-email: GrCOTE7 <GrCOTE7@gmail.com>
6
+ License-Expression: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: python-dotenv
12
+
13
+ # PyMoX - GC7
14
+
15
+ Trousse à outils utiles pour devs en PyMoX
16
+
17
+ v1.06 2ème
18
+
19
+ ---
20
+
21
+ ## Rapide mémo
22
+
23
+ ```bash
24
+ py -m venv .venv
25
+ .\.venv\Scripts\activate
26
+ pip install -r requirements.txt
27
+
28
+ py -m build
29
+ twine check dist/*
30
+ twine upload dist/* --verbose
31
+
32
+ git log --oneline
33
+
34
+ semantic-release version
35
+ semantic-release version --print
36
+
37
+ semantic-release publish
38
+
39
+ semantic-release --noop version
40
+ Cela te dira si une version serait générée.
41
+
42
+ semantic-release version --commit --tag --no-push
43
+
44
+ Cela va :
45
+ Lire les commits
46
+ Calculer la prochaine version (ex: 0.2.0)
47
+ Modifier __version__ dans gc7/__init__.py
48
+ Créer un commit et un tag localement
49
+
50
+ Remove-Item -Recurse -Force dist, src/gc7/gc7.egg-info
51
+
52
+ git commit --allow-empty -m "feat: add dummy feature for version bump"
53
+ git commit --allow-empty -m "fix: déclenchement de la release 1.0.1"
54
+ git push origin main
55
+
56
+ voir conventional commits: https://www.conventionalcommits.org/en/v1.0.0/
57
+
58
+ En cas de volonté de revenir sur une version précédente (Problème avec PyPI: Interdit de reculer):
59
+ git revert <hash du commit> (pour ramener la main du dépôt GH)
60
+ dans le __ini__.py, mettre : __version__='x.y.z' (> au dernier de PyPI)
61
+ refaire le build + renvoi:
62
+ py -m build
63
+ twine upload dist/*
64
+
65
+ Désinstaller tous les packages de l'env global :
66
+ pip freeze | ForEach-Object { pip uninstall -y $_ }
67
+
68
+ # 1. Crée une branche temporaire pour garder les fichiers
69
+ git checkout --orphan temp_branch
70
+
71
+ # 2. Ajoute tous les fichiers à cette nouvelle branche
72
+ git add .
73
+
74
+ # 3. Fais un commit initial
75
+ git commit -m "Initial commit"
76
+
77
+ # 4. Supprime l'ancienne branche main
78
+ git branch -D main
79
+
80
+ # 5. Renomme la branche temporaire en main
81
+ git branch -m main
82
+
83
+ # 6. Force le push vers GitHub (⚠️ cela écrase l’historique distant)
84
+ git push -f origin main
85
+
86
+ git log main --decorate --oneline
87
+
88
+ ---
89
+
90
+ from pymox_tools1 import greetings as gt
91
+ from pymox_tools1 import tokens as tk
92
+
93
+ if __name__ == "__main__":
94
+ tk.tokens()
95
+ print(gt.hello(), "\n" + gt.bye())
96
+
97
+ ```
@@ -0,0 +1,85 @@
1
+ # PyMoX - GC7
2
+
3
+ Trousse à outils utiles pour devs en PyMoX
4
+
5
+ v1.06 2ème
6
+
7
+ ---
8
+
9
+ ## Rapide mémo
10
+
11
+ ```bash
12
+ py -m venv .venv
13
+ .\.venv\Scripts\activate
14
+ pip install -r requirements.txt
15
+
16
+ py -m build
17
+ twine check dist/*
18
+ twine upload dist/* --verbose
19
+
20
+ git log --oneline
21
+
22
+ semantic-release version
23
+ semantic-release version --print
24
+
25
+ semantic-release publish
26
+
27
+ semantic-release --noop version
28
+ Cela te dira si une version serait générée.
29
+
30
+ semantic-release version --commit --tag --no-push
31
+
32
+ Cela va :
33
+ Lire les commits
34
+ Calculer la prochaine version (ex: 0.2.0)
35
+ Modifier __version__ dans gc7/__init__.py
36
+ Créer un commit et un tag localement
37
+
38
+ Remove-Item -Recurse -Force dist, src/gc7/gc7.egg-info
39
+
40
+ git commit --allow-empty -m "feat: add dummy feature for version bump"
41
+ git commit --allow-empty -m "fix: déclenchement de la release 1.0.1"
42
+ git push origin main
43
+
44
+ voir conventional commits: https://www.conventionalcommits.org/en/v1.0.0/
45
+
46
+ En cas de volonté de revenir sur une version précédente (Problème avec PyPI: Interdit de reculer):
47
+ git revert <hash du commit> (pour ramener la main du dépôt GH)
48
+ dans le __ini__.py, mettre : __version__='x.y.z' (> au dernier de PyPI)
49
+ refaire le build + renvoi:
50
+ py -m build
51
+ twine upload dist/*
52
+
53
+ Désinstaller tous les packages de l'env global :
54
+ pip freeze | ForEach-Object { pip uninstall -y $_ }
55
+
56
+ # 1. Crée une branche temporaire pour garder les fichiers
57
+ git checkout --orphan temp_branch
58
+
59
+ # 2. Ajoute tous les fichiers à cette nouvelle branche
60
+ git add .
61
+
62
+ # 3. Fais un commit initial
63
+ git commit -m "Initial commit"
64
+
65
+ # 4. Supprime l'ancienne branche main
66
+ git branch -D main
67
+
68
+ # 5. Renomme la branche temporaire en main
69
+ git branch -m main
70
+
71
+ # 6. Force le push vers GitHub (⚠️ cela écrase l’historique distant)
72
+ git push -f origin main
73
+
74
+ git log main --decorate --oneline
75
+
76
+ ---
77
+
78
+ from pymox_tools1 import greetings as gt
79
+ from pymox_tools1 import tokens as tk
80
+
81
+ if __name__ == "__main__":
82
+ tk.tokens()
83
+ print(gt.hello(), "\n" + gt.bye())
84
+
85
+ ```
@@ -0,0 +1,71 @@
1
+ [project]
2
+ name = "pymox_tools"
3
+ dynamic = ["version"]
4
+ # version = "v0.1.2" # sera géré automatiquement par semantic-release
5
+ # version = "0.0.6" # valeur placeholder, ignorée par semantic-release
6
+ description = "Un module avec plein d'outils utiles pour devs en PyMoX (PY-thon - MO-jo - Flet-X)"
7
+ authors = [{ name = "GrCOTE7", email = "GrCOTE7@gmail.com" }]
8
+ # readme = {file = "README.md", encoding = "utf-8"}
9
+ readme = "README.md"
10
+ # readme = {file = "README.md", content-type = "text/markdown", encoding = "utf-8"}
11
+ license = "MIT"
12
+ classifiers = [
13
+ "Programming Language :: Python :: 3",
14
+ "Operating System :: OS Independent",
15
+ ]
16
+ dependencies = [
17
+ # Ajoute ici tes dépendances, ex:
18
+ # "requests >=2.0.0"
19
+ "python-dotenv",
20
+ # "setuptools_scm"
21
+ ]
22
+ requires-python = ">=3.10"
23
+
24
+ [build-system]
25
+ requires = ["setuptools>=77.0.0", "setuptools_scm", "wheel"]
26
+ # requires = ["setuptools>=61.0", "setuptools_scm>=7.0"]
27
+ build-backend = "setuptools.build_meta"
28
+
29
+ [tool.semantic_release]
30
+ tag_format = "v{version}"
31
+ version_variable = "src/pymox_tools1/__init__.py:__version__"
32
+ repository = "https://github.com/PyMoX-fr/GC7"
33
+ hvcs = "github"
34
+ github_token = "env:GH_TOKEN"
35
+
36
+ pypi_token = "env:PYPI_TOKEN"
37
+ version_source = "tag"
38
+ build_command = "python -m build"
39
+ log_level = "DEBUG"
40
+
41
+
42
+ upload_sdist = true # publie également le source distribution sur PyPI
43
+ upload_wheel = true # publie également le wheel sur PyPI
44
+ verify_release_commit = true
45
+
46
+ # commit_version_number = true
47
+ # commit_message = "chore(release): version {version}"
48
+
49
+ branch = "main" # branch de travail
50
+ # commit_parser = "conventional" # essayer emoji
51
+ # commit_parser = "semantic_release.commit_parser.emoji:parse_commit_message:"
52
+
53
+
54
+ # upload_to_repository = true # active la publication sur PyPI
55
+ # upload_to_pypi = true # active la publication sur PyPI
56
+
57
+ # [tool.semantic_release.changelog.default_templates]
58
+ # changelog_file = "CHANGELOG.md"
59
+
60
+ [tool.setuptools]
61
+ package-dir = { "" = "src" }
62
+ packages = ["pymox_tools1"] # dossier Python
63
+
64
+ [tool.setuptools.package-data]
65
+ "*" = ["*.txt", "*.json"] # si tu as des fichiers à inclure
66
+
67
+ # version_scheme = "release-branch-semver" # empêche les suffixes .devX ou .dirty
68
+ # [tool.setuptools_scm]
69
+ # # local_scheme = "no-local-version"
70
+ # tag_regex = "^v?(?P<version>[0-9]+(\\.[0-9]+)+)$"
71
+ # write_to = "src/pymox_tools1/_version.py"
Binary file
@@ -0,0 +1,20 @@
1
+ mkdir test-semantic
2
+ cd test-semantic
3
+ python -m venv .venv
4
+ .venv\Scripts\activate # ou source .venv/bin/activate sur Unix
5
+ pip install python-semantic-release build
6
+
7
+ mkdir testpkg
8
+ echo '__version__ = "0.1.0"' > testpkg/__init__.py
9
+
10
+ echo '''
11
+ [tool.semantic_release]
12
+ version_variable = "testpkg/__init__.py:__version__"
13
+ build_command = "python -m build"
14
+ upload_to_pypi = false
15
+ log_level = "DEBUG"
16
+ ''' > pyproject.toml
17
+
18
+ git init
19
+ git add .
20
+ git commit -m "feat: initial commit"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,97 @@
1
+ Metadata-Version: 2.4
2
+ Name: pymox_tools
3
+ Version: 0.0.0
4
+ Summary: Un module avec plein d'outils utiles pour devs en PyMoX (PY-thon - MO-jo - Flet-X)
5
+ Author-email: GrCOTE7 <GrCOTE7@gmail.com>
6
+ License-Expression: MIT
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Operating System :: OS Independent
9
+ Requires-Python: >=3.10
10
+ Description-Content-Type: text/markdown
11
+ Requires-Dist: python-dotenv
12
+
13
+ # PyMoX - GC7
14
+
15
+ Trousse à outils utiles pour devs en PyMoX
16
+
17
+ v1.06 2ème
18
+
19
+ ---
20
+
21
+ ## Rapide mémo
22
+
23
+ ```bash
24
+ py -m venv .venv
25
+ .\.venv\Scripts\activate
26
+ pip install -r requirements.txt
27
+
28
+ py -m build
29
+ twine check dist/*
30
+ twine upload dist/* --verbose
31
+
32
+ git log --oneline
33
+
34
+ semantic-release version
35
+ semantic-release version --print
36
+
37
+ semantic-release publish
38
+
39
+ semantic-release --noop version
40
+ Cela te dira si une version serait générée.
41
+
42
+ semantic-release version --commit --tag --no-push
43
+
44
+ Cela va :
45
+ Lire les commits
46
+ Calculer la prochaine version (ex: 0.2.0)
47
+ Modifier __version__ dans gc7/__init__.py
48
+ Créer un commit et un tag localement
49
+
50
+ Remove-Item -Recurse -Force dist, src/gc7/gc7.egg-info
51
+
52
+ git commit --allow-empty -m "feat: add dummy feature for version bump"
53
+ git commit --allow-empty -m "fix: déclenchement de la release 1.0.1"
54
+ git push origin main
55
+
56
+ voir conventional commits: https://www.conventionalcommits.org/en/v1.0.0/
57
+
58
+ En cas de volonté de revenir sur une version précédente (Problème avec PyPI: Interdit de reculer):
59
+ git revert <hash du commit> (pour ramener la main du dépôt GH)
60
+ dans le __ini__.py, mettre : __version__='x.y.z' (> au dernier de PyPI)
61
+ refaire le build + renvoi:
62
+ py -m build
63
+ twine upload dist/*
64
+
65
+ Désinstaller tous les packages de l'env global :
66
+ pip freeze | ForEach-Object { pip uninstall -y $_ }
67
+
68
+ # 1. Crée une branche temporaire pour garder les fichiers
69
+ git checkout --orphan temp_branch
70
+
71
+ # 2. Ajoute tous les fichiers à cette nouvelle branche
72
+ git add .
73
+
74
+ # 3. Fais un commit initial
75
+ git commit -m "Initial commit"
76
+
77
+ # 4. Supprime l'ancienne branche main
78
+ git branch -D main
79
+
80
+ # 5. Renomme la branche temporaire en main
81
+ git branch -m main
82
+
83
+ # 6. Force le push vers GitHub (⚠️ cela écrase l’historique distant)
84
+ git push -f origin main
85
+
86
+ git log main --decorate --oneline
87
+
88
+ ---
89
+
90
+ from pymox_tools1 import greetings as gt
91
+ from pymox_tools1 import tokens as tk
92
+
93
+ if __name__ == "__main__":
94
+ tk.tokens()
95
+ print(gt.hello(), "\n" + gt.bye())
96
+
97
+ ```
@@ -0,0 +1,21 @@
1
+ .env_example
2
+ .gitignore
3
+ CHANGELOG.md
4
+ README.md
5
+ pyproject.toml
6
+ requirements.txt
7
+ set_semantic.sh
8
+ teste_write_version.py
9
+ .github/workflows/publish.yml
10
+ .zencoder/rules/repo.md
11
+ src/pymox_tools.egg-info/PKG-INFO
12
+ src/pymox_tools.egg-info/SOURCES.txt
13
+ src/pymox_tools.egg-info/dependency_links.txt
14
+ src/pymox_tools.egg-info/requires.txt
15
+ src/pymox_tools.egg-info/top_level.txt
16
+ src/pymox_tools1/__init__.py
17
+ src/pymox_tools1/commits_semantic.md
18
+ src/pymox_tools1/compare_keys.py
19
+ src/pymox_tools1/convert_readme.py
20
+ src/pymox_tools1/greetings.py
21
+ src/pymox_tools1/tokens.py
@@ -0,0 +1 @@
1
+ python-dotenv
@@ -0,0 +1 @@
1
+ pymox_tools1
@@ -0,0 +1 @@
1
+ __version__ = "0.0.0"
@@ -0,0 +1,22 @@
1
+ ### 📦 Version SemVer : MAJOR.MINOR.PATCH
2
+
3
+ | Type de changement | Préfixe anglais | Traduction française | Incrément |
4
+ |-----------------------------|---------------------------|----------------------------------------------------|---------------------------------|
5
+ | 🧨 Rupture de compatibilité | `BREAKING CHANGE:` ou `!` | Changement majeur (rupture API, suppression, etc.) | **MAJOR** (ex: `1.2.3 → 2.0.0`) |
6
+ | ✨ Nouvelle fonctionnalité | `feat:` | Fonctionnalité (ajout sans rupture) | **MINOR** (ex: `1.2.3 → 1.3.0`) |
7
+ | 🐛 Correction de bug | `fix:` | Correction (bug, typo, etc.) | **PATCH** (ex: `1.2.3 → 1.2.4`) |
8
+
9
+
10
+ ### 🧠 Autres types de commits (ne changent pas la version)
11
+
12
+ | Préfixe anglais | Traduction française | Impact sur version |
13
+ |-----------------|--------------------------------|-------------------------------------------------------------|
14
+ | `docs:` | Documentation | Aucun |
15
+ | `style:` | Formatage (indentation, etc.) | Aucun |
16
+ | `refactor:` | Refactorisation | Aucun |
17
+ | `perf:` | Optimisation de performance | Aucun |
18
+ | `test:` | Ajout ou modification de tests | Aucun |
19
+ | `chore:` | Tâches diverses | Aucun |
20
+ | `ci:` | Intégration continue | Aucun |
21
+ | `build:` | Configuration de build | Aucun |
22
+ | `revert:` | Annulation d’un commit | Aucun (sauf si le commit annulé était un `feat:` ou `fix:`) |
@@ -0,0 +1,28 @@
1
+ import os
2
+ from dotenv import dotenv_values, load_dotenv
3
+
4
+ # Charge les variables du fichier .env
5
+ env_file_values = dotenv_values(".env") # dict sans override
6
+ load_dotenv(override=False) # ne modifie pas l'environnement
7
+
8
+ # Variables d'environnement actuelles
9
+ env_runtime_values = {
10
+ "GH_TOKEN": os.getenv("GH_TOKEN"),
11
+ "PYPI_TOKEN": os.getenv("PYPI_TOKEN"),
12
+ }
13
+
14
+ # Comparaison
15
+ print("\n🔍 Comparaison des clés GH_TOKEN et PYPI_TOKEN\n")
16
+
17
+ for key in ["GH_TOKEN", "PYPI_TOKEN"]:
18
+ file_val = env_file_values.get(key)
19
+ env_val = env_runtime_values.get(key)
20
+
21
+ if file_val == env_val:
22
+ print(f"✅ {key} est identique dans .env et l'environnement")
23
+ else:
24
+ print(f"❌ {key} est différent !")
25
+ print(f" .env : {file_val}")
26
+ print(f" environnement : {env_val}")
27
+
28
+ print("\n" + "-" * 60)
@@ -0,0 +1,6 @@
1
+ # convert_readme.py
2
+ with open("README.md", "r", encoding="cp1252", errors="replace") as f:
3
+ content = f.read()
4
+
5
+ with open("README2.md", "w", encoding="utf-8") as f:
6
+ f.write(content)
@@ -0,0 +1,10 @@
1
+ def hello():
2
+ return f"Salut les gens !"
3
+
4
+
5
+ def bye():
6
+ return f"Bye-bye les gens !"
7
+
8
+
9
+ if __name__ == "__main__":
10
+ print(hello(), "\n" + bye())
@@ -0,0 +1,26 @@
1
+ def tokens():
2
+ from setuptools_scm import get_version
3
+
4
+ print("\nDernière version pymox_tools1: " + get_version() + "\n" + ("-" * 71))
5
+ from dotenv import load_dotenv
6
+ import os
7
+
8
+ load_dotenv() # Charge les variables depuis .env
9
+ # load_dotenv(override=True)
10
+
11
+ gh_token = os.getenv("GH_TOKEN")
12
+ pypi_token = os.getenv("PYPI_TOKEN")
13
+
14
+ print(f"GH_TOKEN: {gh_token}\n\nPYPI_TOKEN: {pypi_token}\n")
15
+
16
+ return f"Salut les gens !"
17
+
18
+
19
+ if __name__ == "__main__":
20
+
21
+ tokens()
22
+
23
+ # import greetings as gt
24
+ from pymox_tools1 import greetings as gt
25
+
26
+ print(gt.hello(), "\n" + gt.bye())
@@ -0,0 +1,10 @@
1
+ import re
2
+
3
+ with open("gc7/__init__.py", "r+") as f:
4
+ content = f.read()
5
+ content = re.sub(
6
+ r'__version__\s*=\s*["\'].*?["\']', '__version__ = "1.1.0"', content
7
+ )
8
+ f.seek(0)
9
+ f.write(content)
10
+ f.truncate()