Skip to content

Commit

Permalink
Update Requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedro Maciel Xavier committed Sep 25, 2024
1 parent 195c937 commit eb6ed80
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ToQUBO"
uuid = "9a412ddf-83fa-43b6-9748-7843c851aa65"
authors = ["pedromxavier <[email protected]>", "pedroripper <[email protected]>", "joaquimg <[email protected]>", "AndradeTiago <[email protected]>", "bernalde <[email protected]>"]
authors = ["pedromxavier <mail@pedro.ϵλ>", "pedroripper <[email protected]>", "joaquimg <[email protected]>", "AndradeTiago <[email protected]>", "bernalde <[email protected]>"]
version = "0.1.9"

[deps]
Expand All @@ -13,5 +13,5 @@ TOML = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
[compat]
MathOptInterface = "1"
PseudoBooleanOptimization = "0.2"
QUBOTools = "0.9"
QUBOTools = "0.10"
julia = "1.9"
34 changes: 31 additions & 3 deletions src/ToQUBO.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,37 @@ import PseudoBooleanOptimization as PBO
import QUBOTools

# Versioning
using TOML
const __PROJECT__ = abspath(@__DIR__, "..")
const __VERSION__ = VersionNumber(getindex(TOML.parsefile(joinpath(__PROJECT__, "Project.toml")), "version"))
import TOML

const __PROJECT__ = Ref{Union{String,Nothing}}(nothing)

function __project__()
if isnothing(__PROJECT__[])
proj_path = abspath(dirname(@__DIR__))

@assert isdir(proj_path)

__PROJECT__[] = proj_path
end

return __PROJECT__[]::String
end

const __VERSION__ = Ref{Union{VersionNumber,Nothing}}(nothing)

function __version__()::VersionNumber
if isnothing(__VERSION__[])
proj_file_path = abspath(__project__(), "Project.toml")

@assert isfile(proj_file_path)

proj_file_data = TOML.parsefile(proj_file_path)

__VERSION__[] = VersionNumber(proj_file_data["version"])
end

return __VERSION__[]::VersionNumber
end

# MOI Aliases
const MOIU = MOI.Utilities
Expand Down

0 comments on commit eb6ed80

Please sign in to comment.