Skip to main content
Sign in
Snippets Groups Projects
Commit 360f7202 authored by Emmanuel Raviart's avatar Emmanuel Raviart
Browse files

Merge branch 'check_versions' into 'master'

Check versions

See merge request openfisca/openfisca-france-reforms!11
parents 204612e9 695aaa80
No related branches found
No related tags found
1 merge request!11Check versions
Pipeline #1096 passed
Pipeline: OpenFisca-JSON-Model

#1098

    ...@@ -7,6 +7,16 @@ interface Package { ...@@ -7,6 +7,16 @@ interface Package {
    version: string version: string
    } }
    interface PyProject {
    tool: {
    poetry: {
    dependencies: { [name: string]: unknown }
    name: string
    version: string
    }
    }
    }
    export interface VersionObject { export interface VersionObject {
    major: number major: number
    minor: number minor: number
    ...@@ -207,6 +217,32 @@ async function main() { ...@@ -207,6 +217,32 @@ async function main() {
    await $`git status` await $`git status`
    await $`git remote set-url origin git@git.leximpact.dev:openfisca/openfisca-france-reforms.git` await $`git remote set-url origin git@git.leximpact.dev:openfisca/openfisca-france-reforms.git`
    if (CI_COMMIT_BRANCH.match(/^\d+_\d+_\d+$/) === null) {
    // Push doesn't occur in a "version" branch.
    // Ensure that version number is "0.0.0".
    const pyProjectToml = await fs.readFile("pyproject.toml")
    const pyProject = toml.parse(
    pyProjectToml,
    "\n",
    ) as unknown as PyProject
    const { poetry } = pyProject.tool
    const { version } = poetry
    assert.strictEqual(
    version,
    "0.0.0",
    `Project version must be "0.0.0", got "${version}" instead.`,
    )
    // Ensure that OpenFisca-France version is "*".
    const openFiscaFranceVersion = poetry.dependencies["openfisca-france"]
    assert.notStrictEqual(
    openFiscaFranceVersion,
    undefined,
    "Package openfisca-france is missing from pyproject.toml dependencies.",
    )
    }
    // Test OpenFisca-France-Reforms with its current dependencies. // Test OpenFisca-France-Reforms with its current dependencies.
    await $`poetry install` await $`poetry install`
    await $`poetry run python -m openfisca_france_reforms.plf_2022.scripts.run_test` await $`poetry run python -m openfisca_france_reforms.plf_2022.scripts.run_test`
    ... ...
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment