Skip to content

Commit e415a14

Browse files
authored
A few precisions (#82)
* A few precisions * Typos
1 parent e8ed7e3 commit e415a14

File tree

1 file changed

+39
-14
lines changed

1 file changed

+39
-14
lines changed

sharing/index.md

Lines changed: 39 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ These are stored as YAML files in `.github/workflows`, with a slightly convolute
5858
For instance, the file `CI.yml` contains instructions that execute the tests of your package (see below) for each pull request, tag or push to the `main` branch.
5959
This is done on a GitHub server and should theoretically cost you money, but your GitHub repository is public, you get an unlimited workflow budget for free.
6060

61-
A variety workflows and functionalities are available through optional [plugins](https://juliaci.github.io/PkgTemplates.jl/stable/user/#Plugins-1).
61+
A variety of workflows and functionalities are available through optional [plugins](https://juliaci.github.io/PkgTemplates.jl/stable/user/#Plugins-1).
6262
The interactive setting `Template(..., interactive=true)` allows you to select the ones you want for a given package.
6363
Otherwise, you will get the [default selection](https://juliaci.github.io/PkgTemplates.jl/stable/user/#Default-Plugins), which you are encouraged to look at.
6464

@@ -82,19 +82,32 @@ Such tests belong in `test/runtests.jl`, and they are executed with the `]test`
8282
Unit testing may seem rather naive, or even superfluous, but as your code grows more complex, it becomes easier to break something without noticing.
8383
Testing each part separately will increase the reliability of the software you write.
8484

85+
\advanced{
86+
87+
To test the arguments provided to the functions within your code (for instance their sign or value), avoid `@assert` (which can be deactivated) and use [ArgCheck.jl](https://github.com/jw3126/ArgCheck.jl) instead.
88+
89+
}
90+
8591
At some point, your package may require [test-specific dependencies](https://pkgdocs.julialang.org/v1/creating-packages/#Adding-tests-to-the-package).
8692
This often happens when you need to test compatibility with another package, on which you do not depend for the source code itself.
8793
Or it may simply be due to testing-specific packages like the ones we will encounter below.
8894
For interactive testing work, use [TestEnv.jl](https://github.com/JuliaTesting/TestEnv.jl) to activate the full test environment (faster than running `]test` repeatedly).
8995

96+
\vscode{
97+
98+
The Julia extension also has its own testing framework, which relies on sprinkling "test items" throughout the code.
99+
See [TestItemRunner.jl](https://github.com/julia-vscode/TestItemRunner.jl) and [ReTestItems.jl](https://github.com/JuliaTesting/ReTestItems.jl) for indications on how to use them optimally.
100+
101+
}
102+
90103
\advanced{
91104

92105
If you want to have more control over your tests, you can try
93106

94107
* [ReferenceTests.jl](https://github.com/JuliaTesting/ReferenceTests.jl) to compare function outputs with reference files.
95108
* [ReTest.jl](https://github.com/JuliaTesting/ReTest.jl) to define tests next to the source code and control their execution.
96-
* [TestItemRunner.jl](https://github.com/julia-vscode/TestItemRunner.jl) and [ReTestItems.jl](https://github.com/JuliaTesting/ReTestItems.jl) to leverage the testing interface of VSCode.
97-
* [TestReadme.jl](https://github.com/thchr/TestReadme.jl) to test whatever samples are in your README
109+
* [TestSetExtensions.jl](https://github.com/ssfrr/TestSetExtensions.jl) to make test set outputs more readable.
110+
* [TestReadme.jl](https://github.com/thchr/TestReadme.jl) to test whatever code samples are in your README.
98111

99112
}
100113

@@ -130,7 +143,7 @@ The [default formatter](https://www.julia-vscode.org/docs/stable/userguide/forma
130143

131144
\advanced{
132145

133-
You can format code automatically in GitHub pull requests with the [`julia-format` action](https://github.com/julia-actions/julia-format).
146+
You can format code automatically in GitHub pull requests with the [`julia-format` action](https://github.com/julia-actions/julia-format), or add the formatting check directly to your test suite.
134147

135148
}
136149

@@ -142,7 +155,7 @@ It is usually a good idea to include the following in your tests:
142155

143156
```>aqua
144157
using Aqua, MyAwesomePackage
145-
Aqua.test_all(MyAwesomePackage);
158+
Aqua.test_all(MyAwesomePackage)
146159
```
147160

148161
Meanwhile, [JET.jl](https://github.com/aviatesk/JET.jl) is a complementary tool, similar to a static linter.
@@ -184,7 +197,9 @@ Unsurprisingly, its own [documentation](https://documenter.juliadocs.org/stable/
184197
To build the documentation locally, just run
185198

186199
```julia-repl
187-
julia> using Pkg; Pkg.activate("docs")
200+
julia> using Pkg
201+
202+
julia> Pkg.activate("docs")
188203
189204
julia> include("docs/make.jl")
190205
```
@@ -203,11 +218,11 @@ The only thing left to do is to [select the `gh-pages` branch as source](https:/
203218

204219
\advanced{
205220

221+
[DocumenterCitations.jl](https://github.com/ali-ramadhan/DocumenterCitations.jl) allows you to insert citations inside the documentation website from a BibTex file.
222+
206223
Assuming you are looking for an alternative to Documenter.jl, you can try out [Pollen.jl](https://github.com/lorenzoh/Pollen.jl).
207224
In another category, [Replay.jl](https://github.com/AtelierArith/Replay.jl) allows you to replay instructions entered into your terminal as an ASCII video, which is nice for tutorials.
208225

209-
[DocumenterCitations.jl](https://github.com/ali-ramadhan/DocumenterCitations.jl) allows you to insert citations inside the documentation website from a BibTex file.
210-
211226
}
212227

213228
## Literate programming
@@ -235,12 +250,21 @@ To prevent that, the [julia-downgrade-compat](https://github.com/julia-actions/j
235250

236251
}
237252

238-
If your package is useful to others in the community, it may be a good idea to register it, that is, make it part of the pool of packages that can be installed with `Pkg.add(MyAwesomePackage)`.
239-
Note that unregistered packages can also be installed by anyone, but the command is slightly different: `Pkg.add(url="https://github.com/myuser/MyAwesomePackage")`.
253+
If your package is useful to others in the community, it may be a good idea to register it, that is, make it part of the pool of packages that can be installed with
254+
255+
```julia-repl
256+
pkg> add MyAwesomePackage # made possible by registration
257+
```
258+
259+
Note that unregistered packages can also be installed by anyone from the GitHub URL, but this a less reproducible solution:
260+
261+
```julia-repl
262+
pkg> add https://github.com/myuser/MyAwesomePackage # not ideal
263+
```
240264

241265
To register your package, check out the [general registry](https://github.com/JuliaRegistries/General) guidelines.
242266
The [Registrator.jl](https://github.com/JuliaRegistries/Registrator.jl) bot can help you automate the process.
243-
Another handy bot is [TagBot](https://github.com/JuliaRegistries/TagBot), which automatically tags new versions of your package following each release: yet another default plugin in the PkgTemplates.jl setup.
267+
Another handy bot, provided by default with PkgTemplates.jl, is [TagBot](https://github.com/JuliaRegistries/TagBot): it automatically tags new versions of your package following each registry release.
244268
If you have performed the [necessary SSH configuration](https://documenter.juliadocs.org/stable/man/hosting/#travis-ssh), TagBot will also trigger documentation website builds following each release.
245269

246270
\advanced{
@@ -265,16 +289,19 @@ Similarly, your papers should cite the packages you use as dependencies: [PkgCit
265289

266290
## Interoperability
267291

292+
To ensure compatibility with earlier Julia versions, [Compat.jl](https://github.com/JuliaLang/Compat.jl) is your best ally.
293+
268294
Making packages play nice with one another is a key goal of the Julia ecosystem.
269295
Since Julia 1.9, this can be done with [package extensions](https://pkgdocs.julialang.org/v1/creating-packages/#Conditional-loading-of-code-in-packages-(Extensions)), which override specific behaviors based on the presence of a given package in the environment.
270296
[PackageExtensionTools.jl](https://github.com/cjdoris/PackageExtensionTools.jl) eases the pain of setting up extensions.
271-
As for compatibility with earlier Julia versions, [Compat.jl](https://github.com/JuliaLang/Compat.jl) is your best ally.
272297

273298
Furthermore, the Julia ecosystem as a whole plays nice with other programming languages too.
274299
[C and Fortran](https://docs.julialang.org/en/v1/manual/calling-c-and-fortran-code/) are natively supported.
275300
Python can be easily interfaced with the combination of [CondaPkg.jl](https://github.com/cjdoris/CondaPkg.jl) and [PythonCall.jl](https://github.com/cjdoris/PythonCall.jl).
276301
Other language compatibility packages can be found in the [JuliaInterop](https://github.com/JuliaInterop) organization, like [RCall.jl](https://github.com/JuliaInterop/RCall.jl).
277302

303+
Part of interoperability is also flexibility and customization: the [Preferences.jl](https://github.com/JuliaPackaging/Preferences.jl) package gives a nice way to specify various options in TOML files.
304+
278305
\advanced{
279306

280307
Some package developers may need to define what kind of behavior they expect from a certain type, or what a certain method should do.
@@ -283,8 +310,6 @@ This problem of "interfaces" does not yet have a definitive solution in Julia, b
283310

284311
}
285312

286-
Part of interoperability is also flexibility and customization: the [Preferences.jl](https://github.com/JuliaPackaging/Preferences.jl) package gives a nice way to specify various options in TOML files.
287-
288313
## Collaboration
289314

290315
Once your package grows big enough, you might need to bring in some help.

0 commit comments

Comments
 (0)