diff --git a/.github/workflows/issue_to_jira.yml b/.github/workflows/issue_to_jira.yml new file mode 100644 index 000000000..64350558a --- /dev/null +++ b/.github/workflows/issue_to_jira.yml @@ -0,0 +1,22 @@ +name: Create JIRA issue + +on: + issues: + types: [opened] + +permissions: {} + +jobs: + call-workflow-create-jira-issue: + if: startsWith(github.repository, 'MiraGeoscience/') # run on the Mira repo only + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-issue_to_jira.yml@v3 + permissions: + contents: read + issues: write + with: + project-key: 'GEOPY' + components: '[{"name": "gempy"}]' + secrets: + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} diff --git a/.github/workflows/pr_jira_actions.yml b/.github/workflows/pr_jira_actions.yml new file mode 100644 index 000000000..65299b541 --- /dev/null +++ b/.github/workflows/pr_jira_actions.yml @@ -0,0 +1,19 @@ +name: JIRA actions + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review, edited] + +jobs: + call-workflow-pr_jira_actions: + if: | # run on the Mira repo only + startsWith(github.repository, 'MiraGeoscience/') && + (github.event.action != 'edited' || github.event.changes.title != null) + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_actions.yml@v3 + permissions: + contents: read + pull-requests: write + secrets: + JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }} + JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }} + JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }} diff --git a/.github/workflows/python_deploy_dev.yml b/.github/workflows/python_deploy_dev.yml index 7790acda7..65a481b7d 100644 --- a/.github/workflows/python_deploy_dev.yml +++ b/.github/workflows/python_deploy_dev.yml @@ -4,6 +4,23 @@ on: push: tags: - 'v*' # Push events to every version tag (eg. v1.0.0) + workflow_dispatch: + inputs: + publish-conda: + description: 'Publish Conda package' + required: false + type: boolean + default: true + publish-pypi: + description: 'Publish PyPI package' + required: false + type: boolean + default: true + publish-dev-tag: + description: 'Force publish if the version tag is a development version (eg. 3.0.0.dev1)' + required: false + type: boolean + default: false permissions: {} @@ -15,7 +32,7 @@ jobs: call-workflow-conda-publish: name: Publish development conda package on JFrog Artifactory if: github.repository == 'MiraGeoscience/gempy' - uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_rattler_package.yml@v3.6.0-alpha.1 + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_rattler_package.yml@v3.7.0-alpha.1 permissions: id-token: write contents: write @@ -23,26 +40,27 @@ jobs: package-name: gempy python-version: '3.12' recipe-path: conda.recipe/recipe.yaml - source-repo-names: '["public-noremote-conda-dev"]' + source-repo-names: '["gempy-noremote-conda-dev"]' conda-channels: '["conda-forge"]' - publish-repo-names: '["public-noremote-conda-dev"]' + publish-repo-names: '["gempy-noremote-conda-dev"]' build-experimental: true + publish-dev-tag: ${{ github.event.inputs.publish-dev-tag || false }} secrets: JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} call-workflow-pypi-publish: name: Publish development pypi package (JFrog Artifactory) if: github.repository == 'MiraGeoscience/gempy' - uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@v3.6.0-alpha.1 + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@v3.7.0-alpha.1 permissions: id-token: write contents: write with: package-manager: setuptools package-name: gempy - version-tag: ${{ github.ref_name }} + publish-dev-tag: ${{ github.event.inputs.publish-dev-tag || false }} python-version: '3.12' - virtual-repo-names: '["public-pypi-dev"]' + virtual-repo-names: '["gempy-pypi-dev"]' secrets: JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} JFROG_ARTIFACTORY_TOKEN: ${{ secrets.JFROG_ARTIFACTORY_TOKEN }} diff --git a/.github/workflows/python_deploy_prod.yml b/.github/workflows/python_deploy_prod.yml index 20da53fbd..7549215c2 100644 --- a/.github/workflows/python_deploy_prod.yml +++ b/.github/workflows/python_deploy_prod.yml @@ -31,12 +31,12 @@ jobs: if: | github.repository == 'MiraGeoscience/gempy' && (github.event_name == 'release' || github.event.inputs.publish-conda == 'true') - uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@v3.6.0-alpha.1 + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@v3 permissions: id-token: write contents: write with: - virtual-repo-names: '["public-noremote-conda-prod"]' + virtual-repo-names: '["gempy-noremote-conda-prod"]' release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }} secrets: JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} @@ -46,13 +46,13 @@ jobs: if: | github.repository == 'MiraGeoscience/gempy' && (github.event_name == 'release' || github.event.inputs.publish-pypi == 'true') - uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@v3.6.0-alpha.1 + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@v3 permissions: id-token: write contents: write with: package-name: 'gempy' - virtual-repo-names: '["public-pypi-prod"]' + virtual-repo-names: '["gempy-pypi-prod"]' release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }} secrets: JFROG_ARTIFACTORY_URL: ${{ secrets.JFROG_ARTIFACTORY_URL }} diff --git a/.github/workflows/security_scan.yml b/.github/workflows/security_scan.yml new file mode 100644 index 000000000..49675b3f5 --- /dev/null +++ b/.github/workflows/security_scan.yml @@ -0,0 +1,43 @@ +name: Security Scan + +on: + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + branches: + - develop + - main + - release/** + - feature/** + - hotfix/** + push: + branches: + - develop + - main + - release/** + - feature/** + - hotfix/** + +permissions: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + call-workflow-zizmor-annotate: + name: Zizmor analysis (advanced security) + if: github.event_name != 'pull_request' + permissions: + security-events: write + contents: read + actions: read + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-zizmor-advanced-security.yml@v3 + + call-workflow-zizmor-advanced-security: + name: Zizmor analysis (annotate) + if: github.event_name == 'pull_request' + permissions: + checks: write + contents: read + actions: read + uses: MiraGeoscience/CI-tools/.github/workflows/reusable-zizmor-annotate.yml@v3 diff --git a/.gitignore b/.gitignore index 79b97fefa..0a4025718 100644 --- a/.gitignore +++ b/.gitignore @@ -184,4 +184,7 @@ examples/tutorials/z_other_tutorials/json_io/combination_model_computed.json /test/temp/ test/test_modules/run_test.py -.junie \ No newline at end of file +.junie + +/gempy_engine/_version.py +/_version.txt \ No newline at end of file diff --git a/conda.recipe/recipe.yaml b/conda.recipe/recipe.yaml index 4a1bba5ee..7eb5aa532 100644 --- a/conda.recipe/recipe.yaml +++ b/conda.recipe/recipe.yaml @@ -31,7 +31,7 @@ requirements: - setuptools-scm run: - python >=${{ python_min }} - - gempy-engine >=2025.3.0dev0,<2025.4.0 + - gempy-engine >=2026.0.2dev0,<2026.1 - typing_extensions tests: diff --git a/gempy/_version.py b/gempy/_version.py deleted file mode 100644 index 86c00f251..000000000 --- a/gempy/_version.py +++ /dev/null @@ -1,16 +0,0 @@ -# file generated by setuptools_scm -# don't change, don't track in version control -TYPE_CHECKING = False -if TYPE_CHECKING: - from typing import Tuple, Union - VERSION_TUPLE = Tuple[Union[int, str], ...] -else: - VERSION_TUPLE = object - -version: str -__version__: str -__version_tuple__: VERSION_TUPLE -version_tuple: VERSION_TUPLE - -__version__ = version = '2024.2.0.3.dev0+gf344a731.d20240626' -__version_tuple__ = version_tuple = (2024, 2, 0, 3, 'dev0', 'gf344a731.d20240626') diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 000000000..5adc14470 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,2 @@ +[tool.pytest.ini_options] +norecursedirs = [".git", ".venv", "node_modules", "htmlcov", "static", "templates"]