From 0015c5297d3d69a936f413564ca9292f548994c6 Mon Sep 17 00:00:00 2001 From: tmigot Date: Tue, 26 Aug 2025 19:55:28 -0400 Subject: [PATCH] Apply BestieTemplate --- .JuliaFormatter.toml | 10 +- .all-contributorsrc | 5 + .breakage/Project.toml | 6 +- .cirrus.yml | 29 +- .copier-answers.yml | 42 ++ .editorconfig | 18 + .github/ISSUE_TEMPLATE/10-bug-report.yml | 60 +++ .github/ISSUE_TEMPLATE/20-feature-request.yml | 41 ++ .github/ISSUE_TEMPLATE/30-usage.yml | 23 ++ .github/ISSUE_TEMPLATE/99-general.yml | 21 + .github/ISSUE_TEMPLATE/config.yml | 5 + .github/PULL_REQUEST_TEMPLATE.md | 27 ++ .github/workflows/Breakage.yml | 330 +++++++-------- .github/workflows/CompatHelper.yml | 46 ++- .github/workflows/Docs.yml | 57 +++ .github/workflows/Documentation.yml | 23 -- .github/workflows/Lint.yml | 64 +++ .github/workflows/PreCommitUpdate.yml | 40 ++ .github/workflows/ReusableTest.yml | 52 +++ .github/workflows/TagBot.yml | 52 ++- .github/workflows/Test.yml | 48 +++ .github/workflows/TestOnPRs.yml | 29 ++ .github/workflows/ci.yml | 62 --- .github/workflows/format_pr.yml | 32 -- .gitignore | 13 +- .lychee.toml | 12 + .markdownlint.json | 13 + .pre-commit-config.yaml | 53 +++ .yamlfmt.yml | 7 + .yamllint.yml | 2 + .zenodo.json | 38 +- CODE_OF_CONDUCT.md | 133 ++++++ LICENSE | 373 +++++++++++++++++ LICENSE.md | 379 ------------------ Project.toml | 13 +- README.md | 37 +- docs/Project.toml | 2 +- docs/make.jl | 31 +- docs/src/90-contributing.md | 25 ++ docs/src/91-developer.md | 163 ++++++++ docs/src/95-reference.md | 17 + docs/src/index.md | 19 +- docs/src/reference.md | 17 - src/SolverTools.jl | 10 +- src/linesearch/armijo_goldstein.jl | 4 +- test/Project.toml | 9 + test/runtests.jl | 21 +- test/{test_auxiliary.jl => test-auxiliary.jl} | 0 ...{test_linesearch.jl => test-linesearch.jl} | 0 ...t_trust_region.jl => test-trust_region.jl} | 0 50 files changed, 1710 insertions(+), 803 deletions(-) create mode 100644 .all-contributorsrc create mode 100644 .copier-answers.yml create mode 100644 .editorconfig create mode 100644 .github/ISSUE_TEMPLATE/10-bug-report.yml create mode 100644 .github/ISSUE_TEMPLATE/20-feature-request.yml create mode 100644 .github/ISSUE_TEMPLATE/30-usage.yml create mode 100644 .github/ISSUE_TEMPLATE/99-general.yml create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/workflows/Docs.yml delete mode 100644 .github/workflows/Documentation.yml create mode 100644 .github/workflows/Lint.yml create mode 100644 .github/workflows/PreCommitUpdate.yml create mode 100644 .github/workflows/ReusableTest.yml create mode 100644 .github/workflows/Test.yml create mode 100644 .github/workflows/TestOnPRs.yml delete mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/format_pr.yml create mode 100644 .lychee.toml create mode 100644 .markdownlint.json create mode 100644 .pre-commit-config.yaml create mode 100644 .yamlfmt.yml create mode 100644 .yamllint.yml create mode 100644 CODE_OF_CONDUCT.md create mode 100644 LICENSE delete mode 100644 LICENSE.md create mode 100644 docs/src/90-contributing.md create mode 100644 docs/src/91-developer.md create mode 100644 docs/src/95-reference.md delete mode 100644 docs/src/reference.md create mode 100644 test/Project.toml rename test/{test_auxiliary.jl => test-auxiliary.jl} (100%) rename test/{test_linesearch.jl => test-linesearch.jl} (100%) rename test/{test_trust_region.jl => test-trust_region.jl} (100%) diff --git a/.JuliaFormatter.toml b/.JuliaFormatter.toml index 15fa6547..bee44f1a 100644 --- a/.JuliaFormatter.toml +++ b/.JuliaFormatter.toml @@ -1,7 +1,7 @@ -margin = 100 +annotate_untyped_fields_with_any = false indent = 2 -whitespace_typedefs = true -whitespace_ops_in_indices = true +margin = 100 +normalize_line_endings = "unix" remove_extra_newlines = true -annotate_untyped_fields_with_any = false -normalize_line_endings = "unix" \ No newline at end of file +whitespace_ops_in_indices = true +whitespace_typedefs = true diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 00000000..d5c938b4 --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,5 @@ +{ + "projectName": "SolverTools", + "projectOwner": "JuliaSmoothOptimizers", + "files": ["README.md", "docs/src/index.md"] +} diff --git a/.breakage/Project.toml b/.breakage/Project.toml index a65fa1ce..7f17b557 100644 --- a/.breakage/Project.toml +++ b/.breakage/Project.toml @@ -1,3 +1,3 @@ -[deps] -GitHub = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26" -PkgDeps = "839e9fc8-855b-5b3c-a3b7-2833d3dd1f59" +[deps] +GitHub = "bc5e4493-9b4d-5f90-b8aa-2b2bcaad7a26" +PkgDeps = "839e9fc8-855b-5b3c-a3b7-2833d3dd1f59" diff --git a/.cirrus.yml b/.cirrus.yml index ad5fb1d9..a5763184 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,25 +1,12 @@ +freebsd_instance: + image_family: freebsd-13-3 task: - matrix: - - name: FreeBSD - freebsd_instance: - image_family: freebsd-14-2 - env: - matrix: - - JULIA_VERSION: 1 - install_script: | - URL="https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh" - set -x - if [ "$(uname -s)" = "Linux" ] && command -v apt; then - apt update - apt install -y curl - fi - if command -v curl; then - sh -c "$(curl ${URL})" - elif command -v wget; then - sh -c "$(wget ${URL} -q -O-)" - elif command -v fetch; then - sh -c "$(fetch ${URL} -o -)" - fi + name: FreeBSD + env: + matrix: + - JULIA_VERSION: 1 + install_script: + - sh -c "$(fetch https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh -o -)" build_script: - cirrusjl build test_script: diff --git a/.copier-answers.yml b/.copier-answers.yml new file mode 100644 index 00000000..e479324e --- /dev/null +++ b/.copier-answers.yml @@ -0,0 +1,42 @@ +# Changes here will be overwritten by Copier +AddAllcontributors: true +AddCitationCFF: true +AddCodeOfConduct: true +AddCompatHelperCI: true +AddContributionDocs: true +AddCopierCI: false +AddDependabot: false +AddDocs: true +AddDocsCI: true +AddFormatterAndLinterConfigFiles: true +AddGitHubPRTemplate: true +AddGitHubTemplates: true +AddLintCI: true +AddLychee: true +AddMacToCI: true +AddPrecommit: true +AddTagBotCI: true +AddTestCI: true +AddWinToCI: true +Authors: Dominique Orban , Abel Soares Siqueira , + Tangi Migot +AutoIncludeTests: true +CheckExplicitImports: true +CodeOfConductContact: dominique.orban@gerad.ca +ConfigIndentation: 2 +ExplicitImportsChecklist: exclude_all_qualified_accesses_are_public +JuliaIndentation: 2 +JuliaMinCIVersion: lts +JuliaMinVersion: lts +License: MPL-2.0 +LicenseCopyrightHolders: Dominique Orban, Abel Soares Siqueira, Tangi Migot +MarkdownIndentation: 2 +PackageName: SolverTools +PackageOwner: JuliaSmoothOptimizers +PackageUUID: b5612192-2639-5dc1-abfe-fbedd65fab29 +RunJuliaNightlyOnCI: true +StrategyConfirmIncluded: true +StrategyLevel: 3 +StrategyReviewExcluded: false +UseCirrusCI: true +_src_path: C:\Users\tangi\.julia\packages\BestieTemplate\jdG8v diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..cbb163ba --- /dev/null +++ b/.editorconfig @@ -0,0 +1,18 @@ +# https://editorconfig.org +root = true + +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +indent_style = space +trim_trailing_whitespace = true + +[*.jl] +indent_size = 2 + +[*.md] +indent_size = 2 + +[*.{yml,toml,json}] +indent_size = 2 diff --git a/.github/ISSUE_TEMPLATE/10-bug-report.yml b/.github/ISSUE_TEMPLATE/10-bug-report.yml new file mode 100644 index 00000000..0838f1fc --- /dev/null +++ b/.github/ISSUE_TEMPLATE/10-bug-report.yml @@ -0,0 +1,60 @@ +name: Bug Report +description: File a bug report related to running the package +title: "[Bug] " +labels: ["bug"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this bug report! + + Please, before submitting, make sure that: + + - There is not an [existing issue](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/issues) with the same question + - You have read the [contributing guide](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/dev/90-contributing/) + - You are following the [code of conduct](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/blob/main/CODE_OF_CONDUCT.md) + The form below should help you in filling out this issue. + - type: textarea + id: description + attributes: + label: Description + description: Describe the bug + validations: + required: true + - type: input + id: pkg-version + attributes: + label: Package Version + description: What version of the package are you running? + validations: + required: true + - type: input + id: version + attributes: + label: Julia Version + description: What version of Julia are you running? + validations: + required: true + - type: textarea + id: reproduction + attributes: + label: Reproduction steps + description: What steps led to the bug happening? Please provide a minimal reproducible example. + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: shell + - type: dropdown + id: os + attributes: + label: "Operating System" + description: What is the impacted environment? + multiple: true + options: + - Windows + - Linux + - Mac diff --git a/.github/ISSUE_TEMPLATE/20-feature-request.yml b/.github/ISSUE_TEMPLATE/20-feature-request.yml new file mode 100644 index 00000000..ae3fd560 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/20-feature-request.yml @@ -0,0 +1,41 @@ +name: "Feature Request" +description: Suggest a new feature for the package +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this feature request! + + Please, before submitting, make sure that: + + - There is not an [existing issue](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/issues) with the same question + - You have read the [contributing guide](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/dev/90-contributing/) + - You are following the [code of conduct](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/blob/main/CODE_OF_CONDUCT.md) + The form below should help you in filling out this issue. + - type: textarea + id: description + attributes: + label: Description + description: Describe the requested feature + validations: + required: true + - type: textarea + id: validation + attributes: + label: Validation and testing + description: How could we verify that the new feature works? What kind of tests can be done? + - type: textarea + id: motivation + attributes: + label: Motivation + description: Explain why this feature is relevant + - type: textarea + id: target + attributes: + label: Target audience + description: Tell more about the users of this feature, or where it could be useful + - type: textarea + id: can-help + attributes: + label: Can you help? + description: Can you help developing this feature? diff --git a/.github/ISSUE_TEMPLATE/30-usage.yml b/.github/ISSUE_TEMPLATE/30-usage.yml new file mode 100644 index 00000000..0fd583df --- /dev/null +++ b/.github/ISSUE_TEMPLATE/30-usage.yml @@ -0,0 +1,23 @@ +name: "Usage question" +description: Questions related to the usage +labels: ["documentation"] +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this question! + + Please, before submitting, make sure that: + + - You have checked the [documentation](https://JuliaSmoothOptimizers.github.io/SolverTools.jl) and haven't found enough information + - There is not an [existing issue](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/issues) with the same question + - You have read the [contributing guide](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/dev/90-contributing/) + - You are following the [code of conduct](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/blob/main/CODE_OF_CONDUCT.md) + The form below should help you in filling out this issue. + - type: textarea + id: description + attributes: + label: Description + description: Write your question + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/99-general.yml b/.github/ISSUE_TEMPLATE/99-general.yml new file mode 100644 index 00000000..1e589572 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/99-general.yml @@ -0,0 +1,21 @@ +name: "General issue" +description: In case none of the others templates apply +body: + - type: markdown + attributes: + value: | + Thanks for taking the time to fill out this issue! + + Please, before submitting, make sure that: + + - There is not an [existing issue](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/issues) with the same question + - You have read the [contributing guide](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/dev/90-contributing/) + - You are following the [code of conduct](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/blob/main/CODE_OF_CONDUCT.md) + The form below should help you in filling out this issue. + - type: textarea + id: description + attributes: + label: Description + description: Describe the issue + validations: + required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..b7e15975 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: Discussions + url: https://github.com/JuliaSmoothOptimizers/SolverTools.jl/discussions + about: Create and follow discussions here diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..657c2799 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,27 @@ + + +## Related issues + + + + +Closes # + + + + +## Checklist + + + +- [ ] I am following the [contributing guidelines](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/blob/main/docs/src/90-contributing.md) +- [ ] Tests are passing +- [ ] Lint workflow is passing +- [ ] Docs were updated and workflow is passing diff --git a/.github/workflows/Breakage.yml b/.github/workflows/Breakage.yml index 5a9d623d..484ff19f 100644 --- a/.github/workflows/Breakage.yml +++ b/.github/workflows/Breakage.yml @@ -1,165 +1,165 @@ -# Ref: https://securitylab.github.com/research/github-actions-preventing-pwn-requests -name: Breakage - -# read-only repo token -# no access to secrets -on: - pull_request: - -jobs: - # Build dynamically the matrix on which the "break" job will run. - # The matrix contains the packages that depend on ${{ env.pkg }}. - # Job "setup_matrix" outputs variable "matrix", which is in turn - # the output of the "getmatrix" step. - # The contents of "matrix" is a JSON description of a matrix used - # in the next step. It has the form - # { - # "pkg": [ - # "PROPACK", - # "LLSModels", - # "FletcherPenaltySolver" - # ] - # } - setup_matrix: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.getmatrix.outputs.matrix }} - env: - pkg: ${{ github.event.repository.name }} - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: 1 - arch: x64 - - id: getmatrix - run: | - julia -e 'using Pkg; Pkg.Registry.add(RegistrySpec(url = "https://github.com/JuliaRegistries/General.git"))' - julia --project=.breakage -e 'using Pkg; Pkg.update(); Pkg.instantiate()' - pkgs=$(julia --project=.breakage .breakage/get_jso_users.jl ${{ env.pkg }}) - vs='["latest", "stable"]' - # Check if pkgs is empty, and set it to a JSON array if necessary - if [[ -z "$pkgs" || "$pkgs" == "String[]" ]]; then - echo "No packages found; exiting successfully." - exit 0 - fi - vs='["latest", "stable"]' - matrix=$(jq -cn --argjson deps "$pkgs" --argjson vers "$vs" '{pkg: $deps, pkgversion: $vers}') # don't escape quotes like many posts suggest - echo "matrix=$matrix" >> "$GITHUB_OUTPUT" - - break: - needs: setup_matrix - if: needs.setup_matrix.result == 'success' && needs.setup_matrix.outputs.matrix != '' - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: ${{ fromJSON(needs.setup_matrix.outputs.matrix) }} - - steps: - - uses: actions/checkout@v4 - - # Install Julia - - uses: julia-actions/setup-julia@v2 - with: - version: 1 - arch: x64 - - uses: actions/cache@v4 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@v1 - - # Breakage test - - name: 'Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version' - env: - PKG: ${{ matrix.pkg }} - VERSION: ${{ matrix.pkgversion }} - run: | - set -v - mkdir -p ./breakage - git clone https://github.com/JuliaSmoothOptimizers/$PKG.jl.git - cd $PKG.jl - if [ $VERSION == "stable" ]; then - TAG=$(git tag -l "v*" --sort=-creatordate | head -n1) - if [ -z "$TAG" ]; then - TAG="no_tag" - else - git checkout $TAG - fi - else - TAG=$VERSION - fi - export TAG - julia -e 'using Pkg; - PKG, TAG, VERSION = ENV["PKG"], ENV["TAG"], ENV["VERSION"] - joburl = joinpath(ENV["GITHUB_SERVER_URL"], ENV["GITHUB_REPOSITORY"], "actions/runs", ENV["GITHUB_RUN_ID"]) - open("../breakage/breakage-$PKG-$VERSION", "w") do io - try - TAG == "no_tag" && error("No tag for $VERSION") - pkg"activate ."; - pkg"instantiate"; - pkg"dev ../"; - if TAG == "latest" - global TAG = chomp(read(`git rev-parse --short HEAD`, String)) - end - pkg"build"; - pkg"test"; - - print(io, "[![](https://img.shields.io/badge/$TAG-Pass-green)]($joburl)"); - catch e - @error e; - print(io, "[![](https://img.shields.io/badge/$TAG-Fail-red)]($joburl)"); - end; - end' - - - uses: actions/upload-artifact@v4 - with: - name: breakage-${{ matrix.pkg }}-${{ matrix.pkgversion }} - path: breakage/breakage-* - - upload: - needs: break - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/download-artifact@v4 - with: - path: breakage - pattern: breakage-* - merge-multiple: true - - - run: ls -R - - run: | - cd breakage - echo "| Package name | latest | stable |" > summary.md - echo "|--|--|--|" >> summary.md - count=0 - for file in breakage-* - do - if [ $count == "0" ]; then - name=$(echo $file | cut -f2 -d-) - echo -n "| $name | " - else - echo -n "| " - fi - cat $file - if [ $count == "0" ]; then - echo -n " " - count=1 - else - echo " |" - count=0 - fi - done >> summary.md - - - name: PR comment with file - uses: thollander/actions-comment-pull-request@v2 - with: - filePath: breakage/summary.md +# Ref: https://securitylab.github.com/research/github-actions-preventing-pwn-requests +name: Breakage + +# read-only repo token +# no access to secrets +on: + pull_request: + +jobs: + # Build dynamically the matrix on which the "break" job will run. + # The matrix contains the packages that depend on ${{ env.pkg }}. + # Job "setup_matrix" outputs variable "matrix", which is in turn + # the output of the "getmatrix" step. + # The contents of "matrix" is a JSON description of a matrix used + # in the next step. It has the form + # { + # "pkg": [ + # "PROPACK", + # "LLSModels", + # "FletcherPenaltySolver" + # ] + # } + setup_matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.getmatrix.outputs.matrix }} + env: + pkg: ${{ github.event.repository.name }} + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: 1 + arch: x64 + - id: getmatrix + run: | + julia -e 'using Pkg; Pkg.Registry.add(RegistrySpec(url = "https://github.com/JuliaRegistries/General.git"))' + julia --project=.breakage -e 'using Pkg; Pkg.update(); Pkg.instantiate()' + pkgs=$(julia --project=.breakage .breakage/get_jso_users.jl ${{ env.pkg }}) + vs='["latest", "stable"]' + # Check if pkgs is empty, and set it to a JSON array if necessary + if [[ -z "$pkgs" || "$pkgs" == "String[]" ]]; then + echo "No packages found; exiting successfully." + exit 0 + fi + vs='["latest", "stable"]' + matrix=$(jq -cn --argjson deps "$pkgs" --argjson vers "$vs" '{pkg: $deps, pkgversion: $vers}') # don't escape quotes like many posts suggest + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" + + break: + needs: setup_matrix + if: needs.setup_matrix.result == 'success' && needs.setup_matrix.outputs.matrix != '' + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: ${{ fromJSON(needs.setup_matrix.outputs.matrix) }} + + steps: + - uses: actions/checkout@v4 + + # Install Julia + - uses: julia-actions/setup-julia@v2 + with: + version: 1 + arch: x64 + - uses: actions/cache@v4 + env: + cache-name: cache-artifacts + with: + path: ~/.julia/artifacts + key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} + restore-keys: | + ${{ runner.os }}-test-${{ env.cache-name }}- + ${{ runner.os }}-test- + ${{ runner.os }}- + - uses: julia-actions/julia-buildpkg@v1 + + # Breakage test + - name: 'Breakage of ${{ matrix.pkg }}, ${{ matrix.pkgversion }} version' + env: + PKG: ${{ matrix.pkg }} + VERSION: ${{ matrix.pkgversion }} + run: | + set -v + mkdir -p ./breakage + git clone https://github.com/JuliaSmoothOptimizers/$PKG.jl.git + cd $PKG.jl + if [ $VERSION == "stable" ]; then + TAG=$(git tag -l "v*" --sort=-creatordate | head -n1) + if [ -z "$TAG" ]; then + TAG="no_tag" + else + git checkout $TAG + fi + else + TAG=$VERSION + fi + export TAG + julia -e 'using Pkg; + PKG, TAG, VERSION = ENV["PKG"], ENV["TAG"], ENV["VERSION"] + joburl = joinpath(ENV["GITHUB_SERVER_URL"], ENV["GITHUB_REPOSITORY"], "actions/runs", ENV["GITHUB_RUN_ID"]) + open("../breakage/breakage-$PKG-$VERSION", "w") do io + try + TAG == "no_tag" && error("No tag for $VERSION") + pkg"activate ."; + pkg"instantiate"; + pkg"dev ../"; + if TAG == "latest" + global TAG = chomp(read(`git rev-parse --short HEAD`, String)) + end + pkg"build"; + pkg"test"; + + print(io, "[![](https://img.shields.io/badge/$TAG-Pass-green)]($joburl)"); + catch e + @error e; + print(io, "[![](https://img.shields.io/badge/$TAG-Fail-red)]($joburl)"); + end; + end' + + - uses: actions/upload-artifact@v4 + with: + name: breakage-${{ matrix.pkg }}-${{ matrix.pkgversion }} + path: breakage/breakage-* + + upload: + needs: break + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + path: breakage + pattern: breakage-* + merge-multiple: true + + - run: ls -R + - run: | + cd breakage + echo "| Package name | latest | stable |" > summary.md + echo "|--|--|--|" >> summary.md + count=0 + for file in breakage-* + do + if [ $count == "0" ]; then + name=$(echo $file | cut -f2 -d-) + echo -n "| $name | " + else + echo -n "| " + fi + cat $file + if [ $count == "0" ]; then + echo -n " " + count=1 + else + echo " |" + count=0 + fi + done >> summary.md + + - name: PR comment with file + uses: thollander/actions-comment-pull-request@v2 + with: + filePath: breakage/summary.md diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index a26db5b5..210e56f0 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -1,19 +1,51 @@ +# CompatHelper v3.5.0 name: CompatHelper on: schedule: - - cron: '00 00 * * *' + - cron: 0 0 * * * # Every day at 00:00 UTC + workflow_dispatch: + +permissions: + contents: write + pull-requests: write jobs: CompatHelper: runs-on: ubuntu-latest steps: - - uses: julia-actions/setup-julia@latest + - name: Check if Julia is already available in the PATH + id: julia_in_path + run: which julia + continue-on-error: true + - name: Install Julia, but only if it is not already available in the PATH + uses: julia-actions/setup-julia@v2 with: - version: 1.6 - - name: Pkg.add("CompatHelper") - run: julia -e 'using Pkg; Pkg.add("CompatHelper")' - - name: CompatHelper.main() + version: "1" + arch: ${{ runner.arch }} + if: steps.julia_in_path.outcome != 'success' + - name: Use Julia cache + uses: julia-actions/cache@v2 + - name: "Add the General registry via Git" + run: | + import Pkg + ENV["JULIA_PKG_SERVER"] = "" + Pkg.Registry.add("General") + shell: julia --color=yes {0} + - name: "Install CompatHelper" + run: | + import Pkg + name = "CompatHelper" + uuid = "aa819f21-2bde-4658-8897-bab36330d9b7" + version = "3" + Pkg.add(; name, uuid, version) + shell: julia --color=yes {0} + - name: "Run CompatHelper" + run: | + import CompatHelper + CompatHelper.main() + shell: julia --color=yes {0} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: julia -e 'using CompatHelper; CompatHelper.main()' + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + # COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }} diff --git a/.github/workflows/Docs.yml b/.github/workflows/Docs.yml new file mode 100644 index 00000000..55f235f9 --- /dev/null +++ b/.github/workflows/Docs.yml @@ -0,0 +1,57 @@ +name: Docs + +on: + push: + branches: + - main + paths: + - "docs/**" + - "src/**" + - "*.toml" + tags: ["*"] + pull_request: + branches: + - main + paths: + - "docs/**" + - "src/**" + - "*.toml" + types: [opened, synchronize, reopened] + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + docs: + name: Documentation + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: "1" + - name: Use Julia cache + uses: julia-actions/cache@v2 + - name: Instantiate environment with development version of the package + run: | + julia --project=docs -e ' + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate()' + - name: Run doctest + run: | + julia --project=docs -e ' + using Documenter: DocMeta, doctest + using SolverTools + DocMeta.setdocmeta!(SolverTools, :DocTestSetup, :(using SolverTools); recursive=true) + doctest(SolverTools)' + - name: Generate and deploy documentation + run: julia --project=docs docs/make.jl + env: + JULIA_PKG_SERVER: "" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} + GKSwstype: "100" # https://discourse.julialang.org/t/generation-of-documentation-fails-qt-qpa-xcb-could-not-connect-to-display/60988 diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml deleted file mode 100644 index be0b8658..00000000 --- a/.github/workflows/Documentation.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Documentation -on: - push: - branches: - - main - tags: '*' - pull_request: - types: [opened, synchronize, reopened] -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@latest - with: - version: '1' - - name: Install dependencies - run: julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()' - - name: Build and deploy - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - run: julia --project=docs --color=yes docs/make.jl diff --git a/.github/workflows/Lint.yml b/.github/workflows/Lint.yml new file mode 100644 index 00000000..f68ec223 --- /dev/null +++ b/.github/workflows/Lint.yml @@ -0,0 +1,64 @@ +name: Lint + +on: + push: + branches: + - main + tags: ["*"] + pull_request: + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + + lint: + name: Linting + runs-on: ubuntu-latest + steps: + - name: Clone + uses: actions/checkout@v4 + - name: Setup Julia + uses: julia-actions/setup-julia@v2 + with: + version: "1" + - name: Use Julia cache + uses: julia-actions/cache@v2 + - name: Build package (required for ExplicitImports) + uses: julia-actions/julia-buildpkg@v1 + - name: Install Julia packages + run: julia -e 'using Pkg; pkg"add ExplicitImports, JuliaFormatter"' + - name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807 + run: touch requirements.txt + - name: Setup Python + uses: actions/setup-python@v5 + with: + cache: "pip" + python-version: "3.11" + - name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807 + run: rm requirements.txt + - name: Cache pre-commit + uses: actions/cache@v4 + with: + path: ~/.cache/pre-commit + key: ${{ runner.os }}-pre-commit-${{ hashFiles('**/.pre-commit-config.yaml') }} + - name: Install pre-commit + run: pip install pre-commit + - name: Run pre-commit + run: SKIP=no-commit-to-branch pre-commit run -a + link-checker: + name: Link checker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Link Checker + id: lychee + uses: lycheeverse/lychee-action@v2 + with: + fail: true + args: --config '.lychee.toml' . + diff --git a/.github/workflows/PreCommitUpdate.yml b/.github/workflows/PreCommitUpdate.yml new file mode 100644 index 00000000..e5318c55 --- /dev/null +++ b/.github/workflows/PreCommitUpdate.yml @@ -0,0 +1,40 @@ +name: pre-commit Update + +on: + schedule: + - cron: "0 7 1/7 * *" # At 7:00 every 7 days + workflow_dispatch: + +jobs: + pre-commit-update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807 + run: touch requirements.txt + - name: Setup Python + uses: actions/setup-python@v5 + with: + cache: pip + python-version: "3.11" + - name: Hack for setup-python cache # https://github.com/actions/setup-python/issues/807 + run: rm requirements.txt + - name: Install pre-commit + run: pip install pre-commit + - name: Run pre-commit's autoupdate + run: | + # ignore exit code + pre-commit autoupdate || true + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v7 + with: + commit-message: "chore: :robot: pre-commit update" + title: "[AUTO] pre-commit update" + branch: auto-pre-commit-update + delete-branch: true + labels: chore + - name: Check outputs + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/ReusableTest.yml b/.github/workflows/ReusableTest.yml new file mode 100644 index 00000000..12431f28 --- /dev/null +++ b/.github/workflows/ReusableTest.yml @@ -0,0 +1,52 @@ +name: Reusable test + +on: + workflow_call: + inputs: + version: + required: false + type: string + default: "1" + os: + required: false + type: string + default: ubuntu-latest + arch: + required: false + type: string + default: x64 + allow_failure: + required: false + type: boolean + default: false + run_codecov: + required: false + type: boolean + default: false + secrets: + codecov_token: + required: true + +jobs: + test: + name: Julia ${{ inputs.version }} - ${{ inputs.os }} - ${{ inputs.arch }} - ${{ github.event_name }} + runs-on: ${{ inputs.os }} + continue-on-error: ${{ inputs.allow_failure }} + + steps: + - uses: actions/checkout@v4 + - uses: julia-actions/setup-julia@v2 + with: + version: ${{ inputs.version }} + arch: ${{ inputs.arch }} + - name: Use Julia cache + uses: julia-actions/cache@v2 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 + - uses: julia-actions/julia-processcoverage@v1 + if: ${{ inputs.run_codecov }} + - uses: codecov/codecov-action@v4 + if: ${{ inputs.run_codecov }} + with: + file: lcov.info + token: ${{ secrets.codecov_token }} diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index 083baf95..dab9b0b6 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,15 +1,37 @@ -name: TagBot -on: - issue_comment: - types: - - created - workflow_dispatch: -jobs: - TagBot: - if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' - runs-on: ubuntu-latest - steps: - - uses: JuliaRegistries/TagBot@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - ssh: ${{ secrets.DOCUMENTER_KEY }} +name: TagBot + +on: + issue_comment: + types: + - created + workflow_dispatch: + inputs: + lookback: + type: number + default: 3 + +permissions: + actions: read + checks: read + contents: write + deployments: read + issues: read + discussions: read + packages: read + pages: read + pull-requests: read + repository-projects: read + security-events: read + statuses: read + +jobs: + TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' + runs-on: ubuntu-latest + steps: + - uses: JuliaRegistries/TagBot@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + # Edit the following line to reflect the actual name of the GitHub Secret containing your private key + ssh: ${{ secrets.DOCUMENTER_KEY }} + # ssh: ${{ secrets.NAME_OF_MY_SSH_PRIVATE_KEY_SECRET }} diff --git a/.github/workflows/Test.yml b/.github/workflows/Test.yml new file mode 100644 index 00000000..417129c4 --- /dev/null +++ b/.github/workflows/Test.yml @@ -0,0 +1,48 @@ +name: Test + +on: + push: + branches: + - main + tags: ["*"] + workflow_dispatch: + +jobs: + test: + uses: ./.github/workflows/ReusableTest.yml + with: + os: ${{ matrix.os }} + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + allow_failure: ${{ matrix.allow_failure }} + run_codecov: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' }} + secrets: + codecov_token: ${{ secrets.CODECOV_TOKEN }} + strategy: + fail-fast: false + matrix: + version: + - "lts" + - "1" + os: + - ubuntu-latest + - macOS-latest + + - windows-latest + + arch: + - x64 + allow_failure: [false] + include: + - version: "nightly" + os: ubuntu-latest + arch: x64 + allow_failure: true + - version: "nightly" + os: macOS-latest + arch: x64 + allow_failure: true + - version: "nightly" + os: windows-latest + arch: x64 + allow_failure: true diff --git a/.github/workflows/TestOnPRs.yml b/.github/workflows/TestOnPRs.yml new file mode 100644 index 00000000..19a1f5a8 --- /dev/null +++ b/.github/workflows/TestOnPRs.yml @@ -0,0 +1,29 @@ +name: Test on PRs + +on: + pull_request: + branches: + - main + paths: + - "src/**" + - "test/**" + - "*.toml" + types: [opened, synchronize, reopened] + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: only if it is a pull request build. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + test: + uses: ./.github/workflows/ReusableTest.yml + with: + os: ubuntu-latest + version: "1" + arch: x64 + allow_failure: false + run_codecov: true + secrets: + codecov_token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e729355c..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: CI -on: - push: - branches: - - main - pull_request: - types: [opened, synchronize, reopened] -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} - runs-on: ${{ matrix.os }} - continue-on-error: ${{ matrix.allow_failure }} - strategy: - fail-fast: false - matrix: - version: ['lts', '1'] - os: [ubuntu-latest, macos-latest, windows-latest] - arch: [x64] - allow_failure: [false] - include: - - version: '1' - os: macos-latest - arch: arm64 - allow_failure: false - - version: '1' - os: ubuntu-24.04-arm - arch: arm64 - allow_failure: false - - version: 'pre' - os: ubuntu-latest - arch: x64 - allow_failure: true - - version: 'pre' - os: macos-latest - arch: x64 - allow_failure: true - - version: 'pre' - os: windows-latest - arch: x64 - allow_failure: true - steps: - - uses: actions/checkout@v2 - - uses: julia-actions/setup-julia@v2 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: actions/cache@v4 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v1 - with: - file: lcov.info diff --git a/.github/workflows/format_pr.yml b/.github/workflows/format_pr.yml deleted file mode 100644 index c8f53089..00000000 --- a/.github/workflows/format_pr.yml +++ /dev/null @@ -1,32 +0,0 @@ -# https://github.com/julia-actions/julia-format/blob/master/workflows/format_pr.yml -name: format-pr -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Install JuliaFormatter and format - run: | - julia -e 'import Pkg; Pkg.add("JuliaFormatter")' - julia -e 'using JuliaFormatter; format(".")' - # https://github.com/marketplace/actions/create-pull-request - # https://github.com/peter-evans/create-pull-request#reference-example - - name: Create Pull Request - id: cpr - uses: peter-evans/create-pull-request@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: ":robot: Format .jl files" - title: '[AUTO] JuliaFormatter.jl run' - branch: auto-juliaformatter-pr - delete-branch: true - labels: formatting, automated pr, no changelog - - name: Check outputs - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9ed1b594..4d3d00e9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,12 @@ -docs/build -docs/Manifest.toml +*.jl.*.cov +*.jl.cov +*.jl.mem +*.rej +.DS_Store +.benchmarkci Manifest.toml +benchmark/*.json +coverage +docs/build/ +env +node_modules diff --git a/.lychee.toml b/.lychee.toml new file mode 100644 index 00000000..f3841d8d --- /dev/null +++ b/.lychee.toml @@ -0,0 +1,12 @@ +exclude = [ + "@ref", + "@cite", + "^https://github.com/.*/releases/tag/v.*$", + "^https://doi.org/FIXME$", + "^https://JuliaSmoothOptimizers.github.io/SolverTools.jl/stable$", + "zenodo.org/badge/DOI/FIXME$" +] + +exclude_path = [ + "docs/build" +] diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..8bf958ad --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,13 @@ +{ + "MD007": { + "indent": 2, + "start_indented": false + }, + "MD013": { + "line_length": 1000, + "tables": false + }, + "MD033": false, + "MD041": false, + "default": true +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..efdf8ebc --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,53 @@ +repos: + - repo: local + hooks: + # Prevent committing .rej files + - id: forbidden-files + name: forbidden files + entry: found Copier update rejection files; review them and remove them + language: fail + files: "\\.rej$" + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-json + - id: check-toml + - id: check-yaml + - id: file-contents-sorter + files: .JuliaFormatter.toml + args: [--unique] + - id: mixed-line-ending + args: [--fix=lf] + - id: no-commit-to-branch + - id: pretty-format-json + args: [--autofix, --indent=2] + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-merge-conflict + args: [--assume-in-merge] + - repo: https://github.com/igorshubovych/markdownlint-cli + rev: v0.43.0 + hooks: + - id: markdownlint-fix + - repo: https://github.com/citation-file-format/cffconvert + rev: 054bda51dbe278b3e86f27c890e3f3ac877d616c + hooks: + - id: validate-cff + - repo: https://github.com/google/yamlfmt + rev: v0.16.0 + hooks: + - id: yamlfmt + - repo: https://github.com/adrienverge/yamllint + rev: v1.35.1 + hooks: + - id: yamllint + - repo: https://github.com/ericphanson/ExplicitImports.jl + rev: v1.10.1 + hooks: + - id: explicit-imports + name: ExplicitImports checks + args: [--print, --checklist, exclude_all_qualified_accesses_are_public] + - repo: https://github.com/domluna/JuliaFormatter.jl + rev: v2.0.0 + hooks: + - id: julia-formatter diff --git a/.yamlfmt.yml b/.yamlfmt.yml new file mode 100644 index 00000000..6f5fab32 --- /dev/null +++ b/.yamlfmt.yml @@ -0,0 +1,7 @@ +# https://github.com/google/yamlfmt/blob/main/docs/config-file.md +formatter: + type: basic + retain_line_breaks_single: true + indent: 2 +line_ending: lf # matching other hooks settings +exclude: ['.copier-answers.yml'] diff --git a/.yamllint.yml b/.yamllint.yml new file mode 100644 index 00000000..31bcb021 --- /dev/null +++ b/.yamllint.yml @@ -0,0 +1,2 @@ +rules: + indentation: {spaces: 2} diff --git a/.zenodo.json b/.zenodo.json index 5b57b088..95274e56 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -1,34 +1,34 @@ { - "description": "Tools for developing nonlinear optimization solvers in Julia", - "title": "SolverTools.jl", - "upload_type": "software", - "license": "MPL-2.0", + "access_right": "open", + "contributors": [ + { + "name": "Alexis Montoison", + "type": "Researcher" + }, + { + "name": "Jean-Pierre Dussault", + "type": "Researcher" + } + ], "creators": [ { - "affiliation": "École Polytechnique/GERAD - Montréal", + "affiliation": "\u00c9cole Polytechnique/GERAD - Montr\u00e9al", "name": "Dominique Orban" }, { - "affiliation": "Federal University of Paraná - UFPR", + "affiliation": "Federal University of Paran\u00e1 - UFPR", "name": "Abel Soares Siqueira" } ], - "access_right": "open", + "description": "Tools for developing nonlinear optimization solvers in Julia", + "license": "MPL-2.0", "related_identifiers": [ { - "scheme": "url", "identifier": "https://github.com/JuliaSmoothOptimizers/SolverTools.jl/releases/latest", - "relation": "isSupplementTo" + "relation": "isSupplementTo", + "scheme": "url" } ], - "contributors": [ - { - "name": "Alexis Montoison", - "type": "Researcher" - }, - { - "name": "Jean-Pierre Dussault", - "type": "Researcher" - } - ] + "title": "SolverTools.jl", + "upload_type": "software" } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 00000000..03212c0f --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,133 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement: +`dominique.orban@gerad.ca`. +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 2.1, available at +[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. + +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. + +For answers to common questions about this code of conduct, see the FAQ at +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at +[https://www.contributor-covenant.org/translations][translations]. + +[homepage]: https://www.contributor-covenant.org +[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html +[Mozilla CoC]: https://github.com/mozilla/diversity +[FAQ]: https://www.contributor-covenant.org/faq +[translations]: https://www.contributor-covenant.org/translations diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..a612ad98 --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index dd99dbb9..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,379 +0,0 @@ -Copyright (c) 2015-2021: Dominique Orban and Abel Soares Siqueira - -SolverTools.jl is licensed under the [MPL version 2.0](https://www.mozilla.org/MPL/2.0/). - -## License - - Mozilla Public License Version 2.0 - ================================== - - 1. Definitions - -------------- - - 1.1. "Contributor" - means each individual or legal entity that creates, contributes to - the creation of, or owns Covered Software. - - 1.2. "Contributor Version" - means the combination of the Contributions of others (if any) used - by a Contributor and that particular Contributor's Contribution. - - 1.3. "Contribution" - means Covered Software of a particular Contributor. - - 1.4. "Covered Software" - means Source Code Form to which the initial Contributor has attached - the notice in Exhibit A, the Executable Form of such Source Code - Form, and Modifications of such Source Code Form, in each case - including portions thereof. - - 1.5. "Incompatible With Secondary Licenses" - means - - (a) that the initial Contributor has attached the notice described - in Exhibit B to the Covered Software; or - - (b) that the Covered Software was made available under the terms of - version 1.1 or earlier of the License, but not also under the - terms of a Secondary License. - - 1.6. "Executable Form" - means any form of the work other than Source Code Form. - - 1.7. "Larger Work" - means a work that combines Covered Software with other material, in - a separate file or files, that is not Covered Software. - - 1.8. "License" - means this document. - - 1.9. "Licensable" - means having the right to grant, to the maximum extent possible, - whether at the time of the initial grant or subsequently, any and - all of the rights conveyed by this License. - - 1.10. "Modifications" - means any of the following: - - (a) any file in Source Code Form that results from an addition to, - deletion from, or modification of the contents of Covered - Software; or - - (b) any new file in Source Code Form that contains any Covered - Software. - - 1.11. "Patent Claims" of a Contributor - means any patent claim(s), including without limitation, method, - process, and apparatus claims, in any patent Licensable by such - Contributor that would be infringed, but for the grant of the - License, by the making, using, selling, offering for sale, having - made, import, or transfer of either its Contributions or its - Contributor Version. - - 1.12. "Secondary License" - means either the GNU General Public License, Version 2.0, the GNU - Lesser General Public License, Version 2.1, the GNU Affero General - Public License, Version 3.0, or any later versions of those - licenses. - - 1.13. "Source Code Form" - means the form of the work preferred for making modifications. - - 1.14. "You" (or "Your") - means an individual or a legal entity exercising rights under this - License. For legal entities, "You" includes any entity that - controls, is controlled by, or is under common control with You. For - purposes of this definition, "control" means (a) the power, direct - or indirect, to cause the direction or management of such entity, - whether by contract or otherwise, or (b) ownership of more than - fifty percent (50%) of the outstanding shares or beneficial - ownership of such entity. - - 2. License Grants and Conditions - -------------------------------- - - 2.1. Grants - - Each Contributor hereby grants You a world-wide, royalty-free, - non-exclusive license: - - (a) under intellectual property rights (other than patent or trademark) - Licensable by such Contributor to use, reproduce, make available, - modify, display, perform, distribute, and otherwise exploit its - Contributions, either on an unmodified basis, with Modifications, or - as part of a Larger Work; and - - (b) under Patent Claims of such Contributor to make, use, sell, offer - for sale, have made, import, and otherwise transfer either its - Contributions or its Contributor Version. - - 2.2. Effective Date - - The licenses granted in Section 2.1 with respect to any Contribution - become effective for each Contribution on the date the Contributor first - distributes such Contribution. - - 2.3. Limitations on Grant Scope - - The licenses granted in this Section 2 are the only rights granted under - this License. No additional rights or licenses will be implied from the - distribution or licensing of Covered Software under this License. - Notwithstanding Section 2.1(b) above, no patent license is granted by a - Contributor: - - (a) for any code that a Contributor has removed from Covered Software; - or - - (b) for infringements caused by: (i) Your and any other third party's - modifications of Covered Software, or (ii) the combination of its - Contributions with other software (except as part of its Contributor - Version); or - - (c) under Patent Claims infringed by Covered Software in the absence of - its Contributions. - - This License does not grant any rights in the trademarks, service marks, - or logos of any Contributor (except as may be necessary to comply with - the notice requirements in Section 3.4). - - 2.4. Subsequent Licenses - - No Contributor makes additional grants as a result of Your choice to - distribute the Covered Software under a subsequent version of this - License (see Section 10.2) or under the terms of a Secondary License (if - permitted under the terms of Section 3.3). - - 2.5. Representation - - Each Contributor represents that the Contributor believes its - Contributions are its original creation(s) or it has sufficient rights - to grant the rights to its Contributions conveyed by this License. - - 2.6. Fair Use - - This License is not intended to limit any rights You have under - applicable copyright doctrines of fair use, fair dealing, or other - equivalents. - - 2.7. Conditions - - Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted - in Section 2.1. - - 3. Responsibilities - ------------------- - - 3.1. Distribution of Source Form - - All distribution of Covered Software in Source Code Form, including any - Modifications that You create or to which You contribute, must be under - the terms of this License. You must inform recipients that the Source - Code Form of the Covered Software is governed by the terms of this - License, and how they can obtain a copy of this License. You may not - attempt to alter or restrict the recipients' rights in the Source Code - Form. - - 3.2. Distribution of Executable Form - - If You distribute Covered Software in Executable Form then: - - (a) such Covered Software must also be made available in Source Code - Form, as described in Section 3.1, and You must inform recipients of - the Executable Form how they can obtain a copy of such Source Code - Form by reasonable means in a timely manner, at a charge no more - than the cost of distribution to the recipient; and - - (b) You may distribute such Executable Form under the terms of this - License, or sublicense it under different terms, provided that the - license for the Executable Form does not attempt to limit or alter - the recipients' rights in the Source Code Form under this License. - - 3.3. Distribution of a Larger Work - - You may create and distribute a Larger Work under terms of Your choice, - provided that You also comply with the requirements of this License for - the Covered Software. If the Larger Work is a combination of Covered - Software with a work governed by one or more Secondary Licenses, and the - Covered Software is not Incompatible With Secondary Licenses, this - License permits You to additionally distribute such Covered Software - under the terms of such Secondary License(s), so that the recipient of - the Larger Work may, at their option, further distribute the Covered - Software under the terms of either this License or such Secondary - License(s). - - 3.4. Notices - - You may not remove or alter the substance of any license notices - (including copyright notices, patent notices, disclaimers of warranty, - or limitations of liability) contained within the Source Code Form of - the Covered Software, except that You may alter any license notices to - the extent required to remedy known factual inaccuracies. - - 3.5. Application of Additional Terms - - You may choose to offer, and to charge a fee for, warranty, support, - indemnity or liability obligations to one or more recipients of Covered - Software. However, You may do so only on Your own behalf, and not on - behalf of any Contributor. You must make it absolutely clear that any - such warranty, support, indemnity, or liability obligation is offered by - You alone, and You hereby agree to indemnify every Contributor for any - liability incurred by such Contributor as a result of warranty, support, - indemnity or liability terms You offer. You may include additional - disclaimers of warranty and limitations of liability specific to any - jurisdiction. - - 4. Inability to Comply Due to Statute or Regulation - --------------------------------------------------- - - If it is impossible for You to comply with any of the terms of this - License with respect to some or all of the Covered Software due to - statute, judicial order, or regulation then You must: (a) comply with - the terms of this License to the maximum extent possible; and (b) - describe the limitations and the code they affect. Such description must - be placed in a text file included with all distributions of the Covered - Software under this License. Except to the extent prohibited by statute - or regulation, such description must be sufficiently detailed for a - recipient of ordinary skill to be able to understand it. - - 5. Termination - -------------- - - 5.1. The rights granted under this License will terminate automatically - if You fail to comply with any of its terms. However, if You become - compliant, then the rights granted under this License from a particular - Contributor are reinstated (a) provisionally, unless and until such - Contributor explicitly and finally terminates Your grants, and (b) on an - ongoing basis, if such Contributor fails to notify You of the - non-compliance by some reasonable means prior to 60 days after You have - come back into compliance. Moreover, Your grants from a particular - Contributor are reinstated on an ongoing basis if such Contributor - notifies You of the non-compliance by some reasonable means, this is the - first time You have received notice of non-compliance with this License - from such Contributor, and You become compliant prior to 30 days after - Your receipt of the notice. - - 5.2. If You initiate litigation against any entity by asserting a patent - infringement claim (excluding declaratory judgment actions, - counter-claims, and cross-claims) alleging that a Contributor Version - directly or indirectly infringes any patent, then the rights granted to - You by any and all Contributors for the Covered Software under Section - 2.1 of this License shall terminate. - - 5.3. In the event of termination under Sections 5.1 or 5.2 above, all - end user license agreements (excluding distributors and resellers) which - have been validly granted by You or Your distributors under this License - prior to termination shall survive termination. - - ************************************************************************ - * * - * 6. Disclaimer of Warranty * - * ------------------------- * - * * - * Covered Software is provided under this License on an "as is" * - * basis, without warranty of any kind, either expressed, implied, or * - * statutory, including, without limitation, warranties that the * - * Covered Software is free of defects, merchantable, fit for a * - * particular purpose or non-infringing. The entire risk as to the * - * quality and performance of the Covered Software is with You. * - * Should any Covered Software prove defective in any respect, You * - * (not any Contributor) assume the cost of any necessary servicing, * - * repair, or correction. This disclaimer of warranty constitutes an * - * essential part of this License. No use of any Covered Software is * - * authorized under this License except under this disclaimer. * - * * - ************************************************************************ - - ************************************************************************ - * * - * 7. Limitation of Liability * - * -------------------------- * - * * - * Under no circumstances and under no legal theory, whether tort * - * (including negligence), contract, or otherwise, shall any * - * Contributor, or anyone who distributes Covered Software as * - * permitted above, be liable to You for any direct, indirect, * - * special, incidental, or consequential damages of any character * - * including, without limitation, damages for lost profits, loss of * - * goodwill, work stoppage, computer failure or malfunction, or any * - * and all other commercial damages or losses, even if such party * - * shall have been informed of the possibility of such damages. This * - * limitation of liability shall not apply to liability for death or * - * personal injury resulting from such party's negligence to the * - * extent applicable law prohibits such limitation. Some * - * jurisdictions do not allow the exclusion or limitation of * - * incidental or consequential damages, so this exclusion and * - * limitation may not apply to You. * - * * - ************************************************************************ - - 8. Litigation - ------------- - - Any litigation relating to this License may be brought only in the - courts of a jurisdiction where the defendant maintains its principal - place of business and such litigation shall be governed by laws of that - jurisdiction, without reference to its conflict-of-law provisions. - Nothing in this Section shall prevent a party's ability to bring - cross-claims or counter-claims. - - 9. Miscellaneous - ---------------- - - This License represents the complete agreement concerning the subject - matter hereof. If any provision of this License is held to be - unenforceable, such provision shall be reformed only to the extent - necessary to make it enforceable. Any law or regulation which provides - that the language of a contract shall be construed against the drafter - shall not be used to construe this License against a Contributor. - - 10. Versions of the License - --------------------------- - - 10.1. New Versions - - Mozilla Foundation is the license steward. Except as provided in Section - 10.3, no one other than the license steward has the right to modify or - publish new versions of this License. Each version will be given a - distinguishing version number. - - 10.2. Effect of New Versions - - You may distribute the Covered Software under the terms of the version - of the License under which You originally received the Covered Software, - or under the terms of any subsequent version published by the license - steward. - - 10.3. Modified Versions - - If you create software not governed by this License, and you want to - create a new license for such software, you may create and use a - modified version of this License if you rename the license and remove - any references to the name of the license steward (except to note that - such modified license differs from this License). - - 10.4. Distributing Source Code Form that is Incompatible With Secondary - Licenses - - If You choose to distribute Source Code Form that is Incompatible With - Secondary Licenses under the terms of this version of the License, the - notice described in Exhibit B of this License must be attached. - - Exhibit A - Source Code Form License Notice - ------------------------------------------- - - This Source Code Form is subject to the terms of the Mozilla Public - License, v. 2.0. If a copy of the MPL was not distributed with this - file, You can obtain one at http://mozilla.org/MPL/2.0/. - - If it is not possible or desirable to put the notice in a particular - file, then You may include the notice in a location (such as a LICENSE - file in a relevant directory) where a recipient would be likely to look - for such a notice. - - You may add additional accurate notices of copyright ownership. - - Exhibit B - "Incompatible With Secondary Licenses" Notice - --------------------------------------------------------- - - This Source Code Form is "Incompatible With Secondary Licenses", as - defined by the Mozilla Public License, v. 2.0. diff --git a/Project.toml b/Project.toml index 5a7b69a2..d6c867dc 100644 --- a/Project.toml +++ b/Project.toml @@ -11,15 +11,4 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" [compat] LinearOperators = "2.0" NLPModels = "0.21" -julia = "^1.6" - -[extras] -ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a" -CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" -Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" -NLPModelsTest = "7998695d-6960-4d3a-85c4-e1bceb8cd856" -SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["ADNLPModels", "CUDA", "Logging", "NLPModelsTest", "SolverCore", "Test"] +julia = "^1.10" diff --git a/README.md b/README.md index dc5d17e5..62391392 100644 --- a/README.md +++ b/README.md @@ -1,25 +1,34 @@ # SolverTools -![CI](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/workflows/CI/badge.svg?branch=main) +[![Stable Documentation](https://img.shields.io/badge/docs-stable-blue.svg)](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/stable) +[![Development documentation](https://img.shields.io/badge/docs-dev-blue.svg)](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/dev) +[![Test workflow status](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/actions/workflows/Test.yml/badge.svg?branch=main)](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/actions/workflows/Test.yml?query=branch%3Amain) +[![Coverage](https://codecov.io/gh/JuliaSmoothOptimizers/SolverTools.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/JuliaSmoothOptimizers/SolverTools.jl) +[![Lint workflow Status](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/actions/workflows/Lint.yml/badge.svg?branch=main)](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/actions/workflows/Lint.yml?query=branch%3Amain) +[![Docs workflow Status](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/actions/workflows/Docs.yml/badge.svg?branch=main)](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/actions/workflows/Docs.yml?query=branch%3Amain) [![Build Status](https://api.cirrus-ci.com/github/JuliaSmoothOptimizers/SolverTools.jl.svg)](https://cirrus-ci.com/github/JuliaSmoothOptimizers/SolverTools.jl) -[![Stable](https://img.shields.io/badge/docs-stable-3f51b5.svg)](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/stable) -[![Dev](https://img.shields.io/badge/docs-dev-3f51b5.svg)](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/dev) -[![codecov](https://codecov.io/gh/JuliaSmoothOptimizers/SolverTools.jl/branch/main/graph/badge.svg?token=KEKgV7oF2t)](https://codecov.io/gh/JuliaSmoothOptimizers/SolverTools.jl) [![DOI](https://zenodo.org/badge/54757404.svg)](https://zenodo.org/badge/latestdoi/54757404) +[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md) +[![All Contributors](https://img.shields.io/github/all-contributors/JuliaSmoothOptimizers/SolverTools.jl?labelColor=5e1ec7&color=c0ffee&style=flat-square)](#contributors) +[![BestieTemplate](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/JuliaBesties/BestieTemplate.jl/main/docs/src/assets/badge.json)](https://github.com/JuliaBesties/BestieTemplate.jl) -A framework to build novel optimization algorithms in Julia. +## How to Cite -Please cite this repository if you use SolverTools.jl in your work: see [`CITATION.cff`](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/blob/main/CITATION.cff). +If you use SolverTools.jl in your work, please cite using the reference given in [CITATION.cff](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/blob/main/CITATION.cff). -# Installation +## Contributing -``` -add SolverTools -``` +If you want to make contributions of any kind, please first that a look into our [contributing guide directly on GitHub](docs/src/90-contributing.md) or the [contributing page on the website](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/dev/90-contributing/) -# Bug reports and discussions +--- -If you think you found a bug, feel free to open an [issue](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/issues). -Focused suggestions and requests can also be opened as issues. Before opening a pull request, start an issue or a discussion on the topic, please. +### Contributors -If you want to ask a question not suited for a bug report, feel free to start a discussion [here](https://github.com/JuliaSmoothOptimizers/Organization/discussions). This forum is for general discussion about this repository and the [JuliaSmoothOptimizers](https://github.com/JuliaSmoothOptimizers), so questions about any of our packages are welcome. + + + + + + + + diff --git a/docs/Project.toml b/docs/Project.toml index f889e4e7..79d81288 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -5,4 +5,4 @@ SolverTools = "b5612192-2639-5dc1-abfe-fbedd65fab29" [compat] Documenter = "~0.26" -ADNLPModels = "0.7" \ No newline at end of file +ADNLPModels = "0.7" diff --git a/docs/make.jl b/docs/make.jl index f29edfc3..46d05f05 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,20 +1,21 @@ -using Documenter, SolverTools +using SolverTools +using Documenter -makedocs( +DocMeta.setdocmeta!(SolverTools, :DocTestSetup, :(using SolverTools); recursive = true) + +const page_rename = Dict("developer.md" => "Developer docs") # Without the numbers +const numbered_pages = [ + file for + file in readdir(joinpath(@__DIR__, "src")) if file != "index.md" && splitext(file)[2] == ".md" +] + +makedocs(; modules = [SolverTools], - doctest = true, - linkcheck = true, - strict = true, - format = Documenter.HTML( - assets = ["assets/style.css"], - prettyurls = get(ENV, "CI", nothing) == "true", - ), + authors = "Dominique Orban , Abel Soares Siqueira , Tangi Migot ", + repo = "https://github.com/JuliaSmoothOptimizers/SolverTools.jl/blob/{commit}{path}#{line}", sitename = "SolverTools.jl", - pages = ["Home" => "index.md", "Reference" => "reference.md"], + format = Documenter.HTML(; canonical = "https://JuliaSmoothOptimizers.github.io/SolverTools.jl"), + pages = ["index.md"; numbered_pages], ) -deploydocs( - repo = "github.com/JuliaSmoothOptimizers/SolverTools.jl.git", - push_preview = true, - devbranch = "main", -) +deploydocs(; repo = "github.com/JuliaSmoothOptimizers/SolverTools.jl") diff --git a/docs/src/90-contributing.md b/docs/src/90-contributing.md new file mode 100644 index 00000000..04c1c04d --- /dev/null +++ b/docs/src/90-contributing.md @@ -0,0 +1,25 @@ +# [Contributing guidelines](@id contributing) + +First of all, thanks for the interest! + +We welcome all kinds of contribution, including, but not limited to code, documentation, examples, configuration, issue creating, etc. + +Be polite and respectful, and follow the code of conduct. + +## Bug reports and discussions + +If you think you found a bug, feel free to open an [issue](https://github.com/JuliaSmoothOptimizers/SolverTools.jl/issues). +Focused suggestions and requests can also be opened as issues. +Before opening a pull request, start an issue or a discussion on the topic, please. + +## Working on an issue + +If you found an issue that interests you, comment on that issue what your plans are. +If the solution to the issue is clear, you can immediately create a pull request (see below). +Otherwise, say what your proposed solution is and wait for a discussion around it. + +!!! tip + Feel free to ping us after a few days if there are no responses. + +If your solution involves code (or something that requires running the package locally), check the [developer documentation](91-developer.md). +Otherwise, you can use the GitHub interface directly to create your pull request. diff --git a/docs/src/91-developer.md b/docs/src/91-developer.md new file mode 100644 index 00000000..37591d76 --- /dev/null +++ b/docs/src/91-developer.md @@ -0,0 +1,163 @@ +# [Developer documentation](@id dev_docs) + +!!! note "Contributing guidelines" + If you haven't, please read the [Contributing guidelines](90-contributing.md) first. + +If you want to make contributions to this package that involves code, then this guide is for you. + +## First time clone + +!!! tip "If you have writing rights" + If you have writing rights, you don't have to fork. Instead, simply clone and skip ahead. Whenever **upstream** is mentioned, use **origin** instead. + +If this is the first time you work with this repository, follow the instructions below to clone the repository. + +1. Fork this repo +2. Clone your repo (this will create a `git remote` called `origin`) +3. Add this repo as a remote: + + ```bash + git remote add upstream https://github.com/JuliaSmoothOptimizers/SolverTools.jl + ``` + +This will ensure that you have two remotes in your git: `origin` and `upstream`. +You will create branches and push to `origin`, and you will fetch and update your local `main` branch from `upstream`. + +## Linting and formatting + +Install a plugin on your editor to use [EditorConfig](https://editorconfig.org). +This will ensure that your editor is configured with important formatting settings. + +We use [https://pre-commit.com](https://pre-commit.com) to run the linters and formatters. +In particular, the Julia code is formatted using [JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl), so please install it globally first: + +```julia-repl +julia> # Press ] +pkg> activate +pkg> add JuliaFormatter +``` + +To install `pre-commit`, we recommend using [pipx](https://pipx.pypa.io) as follows: + +```bash +# Install pipx following the link +pipx install pre-commit +``` + +With `pre-commit` installed, activate it as a pre-commit hook: + +```bash +pre-commit install +``` + +To run the linting and formatting manually, enter the command below: + +```bash +pre-commit run -a +``` + +**Now, you can only commit if all the pre-commit tests pass**. + +## Testing + +As with most Julia packages, you can just open Julia in the repository folder, activate the environment, and run `test`: + +```julia-repl +julia> # press ] +pkg> activate . +pkg> test +``` + +## Working on a new issue + +We try to keep a linear history in this repo, so it is important to keep your branches up-to-date. + +1. Fetch from the remote and fast-forward your local main + + ```bash + git fetch upstream + git switch main + git merge --ff-only upstream/main + ``` + +2. Branch from `main` to address the issue (see below for naming) + + ```bash + git switch -c 42-add-answer-universe + ``` + +3. Push the new local branch to your personal remote repository + + ```bash + git push -u origin 42-add-answer-universe + ``` + +4. Create a pull request to merge your remote branch into the org main. + +### Branch naming + +- If there is an associated issue, add the issue number. +- If there is no associated issue, **and the changes are small**, add a prefix such as "typo", "hotfix", "small-refactor", according to the type of update. +- If the changes are not small and there is no associated issue, then create the issue first, so we can properly discuss the changes. +- Use dash separated imperative wording related to the issue (e.g., `14-add-tests`, `15-fix-model`, `16-remove-obsolete-files`). + +### Commit message + +- Use imperative or present tense, for instance: *Add feature* or *Fix bug*. +- Have informative titles. +- When necessary, add a body with details. +- If there are breaking changes, add the information to the commit message. + +### Before creating a pull request + +!!! tip "Atomic git commits" + Try to create "atomic git commits" (recommended reading: [The Utopic Git History](https://blog.esciencecenter.nl/the-utopic-git-history-d44b81c09593)). + +- Make sure the tests pass. +- Make sure the pre-commit tests pass. +- Fetch any `main` updates from upstream and rebase your branch, if necessary: + + ```bash + git fetch upstream + git rebase upstream/main BRANCH_NAME + ``` + +- Then you can open a pull request and work with the reviewer to address any issues. + +## Building and viewing the documentation locally + +Following the latest suggestions, we recommend using `LiveServer` to build the documentation. +Here is how you do it: + +1. Run `julia --project=docs` to open Julia in the environment of the docs. +1. If this is the first time building the docs + 1. Press `]` to enter `pkg` mode + 1. Run `pkg> dev .` to use the development version of your package + 1. Press backspace to leave `pkg` mode +1. Run `julia> using LiveServer` +1. Run `julia> servedocs()` + +## Making a new release + +To create a new release, you can follow these simple steps: + +- Create a branch `release-x.y.z` +- Update `version` in `Project.toml` +- Update the `CHANGELOG.md`: + - Rename the section "Unreleased" to "[x.y.z] - yyyy-mm-dd" (i.e., version under brackets, dash, and date in ISO format) + - Add a new section on top of it named "Unreleased" + - Add a new link in the bottom for version "x.y.z" + - Change the "[unreleased]" link to use the latest version - end of line, `vx.y.z ... HEAD`. +- Create a commit "Release vx.y.z", push, create a PR, wait for it to pass, merge the PR. +- Go back to main screen and click on the latest commit (link: ) +- At the bottom, write `@JuliaRegistrator register` + +After that, you only need to wait and verify: + +- Wait for the bot to comment (should take < 1m) with a link to a PR to the registry +- Follow the link and wait for a comment on the auto-merge +- The comment should said all is well and auto-merge should occur shortly +- After the merge happens, TagBot will trigger and create a new GitHub tag. Check on +- After the release is create, a "docs" GitHub action will start for the tag. +- After it passes, a deploy action will run. +- After that runs, the [stable docs](https://JuliaSmoothOptimizers.github.io/SolverTools.jl/stable) should be updated. Check them and look for the version number. diff --git a/docs/src/95-reference.md b/docs/src/95-reference.md new file mode 100644 index 00000000..a0af9e53 --- /dev/null +++ b/docs/src/95-reference.md @@ -0,0 +1,17 @@ +# [Reference](@id reference) + +## Contents + +```@contents +Pages = ["95-reference.md"] +``` + +## Index + +```@index +Pages = ["95-reference.md"] +``` + +```@autodocs +Modules = [SolverTools] +``` diff --git a/docs/src/index.md b/docs/src/index.md index 4bc2ad89..8a2a7248 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -1,4 +1,21 @@ -# [SolverTools.jl documentation](@id Home) +```@meta +CurrentModule = SolverTools +``` +# SolverTools + +Documentation for [SolverTools](https://github.com/JuliaSmoothOptimizers/SolverTools.jl). This package provides tools for developing nonlinear optimization solvers. +## Contributors + +```@raw html + + + + + + + + +``` diff --git a/docs/src/reference.md b/docs/src/reference.md deleted file mode 100644 index e7b31e60..00000000 --- a/docs/src/reference.md +++ /dev/null @@ -1,17 +0,0 @@ -# Reference -​ -## Contents -​ -```@contents -Pages = ["reference.md"] -``` -​ -## Index -​ -```@index -Pages = ["reference.md"] -``` -​ -```@autodocs -Modules = [SolverTools] -``` \ No newline at end of file diff --git a/src/SolverTools.jl b/src/SolverTools.jl index 3b0e5138..b3a104dd 100644 --- a/src/SolverTools.jl +++ b/src/SolverTools.jl @@ -1,10 +1,10 @@ module SolverTools -# stdlib -using LinearAlgebra, Printf - -# our packages -using LinearOperators, NLPModels +using LinearAlgebra: LinearAlgebra, /, BLAS, mul!, norm, tr +using LinearOperators: LinearOperators, AbstractLinearOperator +using NLPModels: + NLPModels, AbstractNLPModel, AbstractNLSModel, Counters, NLPModelMeta, hprod, hprod!, residual! +using Printf: Printf, @printf # Auxiliary. include("auxiliary/blas.jl") diff --git a/src/linesearch/armijo_goldstein.jl b/src/linesearch/armijo_goldstein.jl index ac4b9500..5ebe4c69 100644 --- a/src/linesearch/armijo_goldstein.jl +++ b/src/linesearch/armijo_goldstein.jl @@ -48,9 +48,9 @@ This implementation follows the description given in Worst-case evaluation complexity of non-monotone gradient-related algorithms for unconstrained optimization. Optimization 64(5), 1349–1361 (2015). DOI: 10.1080/02331934.2013.869809 - + The method initializes an interval ` [t_low,t_up]` guaranteed to contain a point satifying both Armijo and Goldstein conditions, and then uses a bisection algorithm to find such a point. - The method is implemented with M=0 (see reference), i.e., Armijo and Goldstein conditions are satisfied only for the current value of the objective `h₀`. + The method is implemented with M=0 (see reference), i.e., Armijo and Goldstein conditions are satisfied only for the current value of the objective `h₀`. # Examples diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 00000000..f4142dac --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,9 @@ +[deps] +ADNLPModels = "54578032-b7ea-4c30-94aa-7cbd1cce6c9a" +CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" +Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" +NLPModels = "a4795742-8479-5a88-8948-cc11e1c8c1a6" +NLPModelsTest = "7998695d-6960-4d3a-85c4-e1bceb8cd856" +SolverCore = "ff4d7338-4cf1-434d-91df-b86cb86fb843" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/runtests.jl b/test/runtests.jl index 9b9bc6db..6352c245 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -42,6 +42,21 @@ macro wrappedallocs(expr) end end -include("test_auxiliary.jl") -include("test_linesearch.jl") -include("test_trust_region.jl") +#= +Don't add your tests to runtests.jl. Instead, create files named + + test-title-for-my-test.jl + +The file will be automatically included inside a `@testset` with title "Title For My Test". +=# +for (root, dirs, files) in walkdir(@__DIR__) + for file in files + if isnothing(match(r"^test-.*\.jl$", file)) + continue + end + title = titlecase(replace(splitext(file[6:end])[1], "-" => " ")) + @testset "$title" begin + include(file) + end + end +end diff --git a/test/test_auxiliary.jl b/test/test-auxiliary.jl similarity index 100% rename from test/test_auxiliary.jl rename to test/test-auxiliary.jl diff --git a/test/test_linesearch.jl b/test/test-linesearch.jl similarity index 100% rename from test/test_linesearch.jl rename to test/test-linesearch.jl diff --git a/test/test_trust_region.jl b/test/test-trust_region.jl similarity index 100% rename from test/test_trust_region.jl rename to test/test-trust_region.jl