Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module instead of the headers.
## Getting started

```sh
mcpp new pipeline --template mcpplibs.mwrap.concurrentqueue@1.0.5
mcpp new pipeline --template mcpplibs.mwrap.concurrentqueue@1.0.5.1
cd pipeline
mcpp run
```
Expand All @@ -39,7 +39,7 @@ queue with a timeout and count primes.

```toml
[dependencies]
"mcpplibs.mwrap.concurrentqueue" = "1.0.5"
mcpplibs.mwrap.concurrentqueue = "1.0.5.1"
```

```cpp
Expand Down
4 changes: 2 additions & 2 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
## 快速开始

```sh
mcpp new pipeline --template mcpplibs.mwrap.concurrentqueue@1.0.5
mcpp new pipeline --template mcpplibs.mwrap.concurrentqueue@1.0.5.1
cd pipeline
mcpp run
```
Expand All @@ -36,7 +36,7 @@ mcpp run

```toml
[dependencies]
"mcpplibs.mwrap.concurrentqueue" = "1.0.5"
mcpplibs.mwrap.concurrentqueue = "1.0.5.1"
```

```cpp
Expand Down
2 changes: 1 addition & 1 deletion mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[package]
namespace = "mcpplibs.mwrap"
name = "concurrentqueue"
version = "1.0.5"
version = "1.0.5.1"
description = "moodycamel::ConcurrentQueue 1.0.5 C++ modules for mcpp (import mcpplibs.mwrap.concurrentqueue;): the lock-free MPMC queue, its blocking variant and semaphore over compat.concurrentqueue, the C API behind the c-api feature"
license = "Apache-2.0"
authors = ["mcpp-community"]
Expand Down
2 changes: 1 addition & 1 deletion templates/pipeline/mcpp.toml.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ kind = "bin"
main = "src/main.cpp"

[dependencies]
"{{self.name}}" = "{{self.version}}"
{{self.name}} = "{{self.version}}"
2 changes: 1 addition & 1 deletion tests/c_api/mcpp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version = "0.1.0"
description = "mcpplibs.mwrap.concurrentqueue with the c-api and no-thread-local features"

[dependencies]
"mcpplibs.mwrap.concurrentqueue" = { path = "../..", features = ["c-api", "no-thread-local"] }
mcpplibs.mwrap.concurrentqueue = { path = "../..", features = ["c-api", "no-thread-local"] }

[dev-dependencies]
compat.gtest = "1.15.2"
2 changes: 1 addition & 1 deletion tools/run_conformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
sources = ["tests/common/*.cpp", "tests/unittests/mallocmacro.cpp"]

[dependencies]
"mcpplibs.mwrap.concurrentqueue" = {{ path = {root}, features = ["c-api"] }}
mcpplibs.mwrap.concurrentqueue = {{ path = {root}, features = ["c-api"] }}
'''


Expand Down
11 changes: 7 additions & 4 deletions tools/test_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,20 @@ def main():
project = temporary / "quickstart"
manifest = project / "mcpp.toml"
text = manifest.read_text()
dependency = tomllib.loads(text)["dependencies"][identity]
# The key is unquoted, so TOML reads it as one table per segment.
dependency = tomllib.loads(text)["dependencies"]
for segment in identity.split("."):
dependency = dependency[segment]
options = {"version": dependency} if isinstance(dependency, str) else dependency
assert options["version"] == version, options
replacement = '{ path = ' + json.dumps(package.as_posix())
if options.get("features"):
replacement += ', features = ' + json.dumps(options["features"])
replacement += ' }'
lines = text.splitlines()
matches = [i for i, line in enumerate(lines) if line.startswith(json.dumps(identity) + " =")]
assert len(matches) == 1, "Expected exactly one qualified dependency from self.name"
lines[matches[0]] = json.dumps(identity) + " = " + replacement
matches = [i for i, line in enumerate(lines) if line.startswith(identity + " =")]
assert len(matches) == 1, "Expected exactly one unquoted qualified dependency from self.name"
lines[matches[0]] = identity + " = " + replacement
manifest.write_text("\n".join(lines) + "\n")
if args.index:
candidate_index = args.index.resolve()
Expand Down
Loading