How to make a private project with no license?
serjflint opened this issue · comments
I am writing a project on self-hosted GitLab for a company. All rights remain on the company. So I can't use any Copyleft License. Am I not allowed to use tyrannosaurus without Apache 2.0 or similar?
I set tool.poetry.license=""
and tool.tyrannosaurus.targets=false
and still get LookupError: Could not find
.
@serjflint Nope, a license isn't required. (By the way, the Apache License is permissive, not copyleft.)
Just do these things:
- Delete
LICENSE.txt
- Under
[tool.poetry]
: setlicense = "Proprietary"
(according to poetry's docs) - Also under
[tool.poetry]
: RemoveLICENSE.txt
frominclude
- Under
[tool.tyrannosaurus.sources]
: Removedoc_license
anddoc_license_url
(these are for documentation)
I haven't tried this on GitLab -- obviously the GitHub-based CI/CD won't work, but it should otherwise be fine. The travis config does work. Let me know if something isn't working.
Just do these things:
- Delete
LICENSE.txt
- Under
[tool.poetry]
: setlicense = "Proprietary"
(according to poetry's docs)
$ tyrannosaurus sync
Running: tyrannosaurus sync
Traceback (most recent call last):
File "/virtualenvs/project/bin/tyrannosaurus", line 8, in <module>
sys.exit(cli())
File "/virtualenvs/project/lib/python3.9/site-packages/typer/main.py", line 214, in __call__
return get_command(self)(*args, **kwargs)
File "/virtualenvs/project/lib/python3.9/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/virtualenvs/project/lib/python3.9/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/virtualenvs/project/lib/python3.9/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/virtualenvs/project/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/virtualenvs/project/lib/python3.9/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/virtualenvs/project/lib/python3.9/site-packages/typer/main.py", line 497, in wrapper
return callback(**use_params) # type: ignore
File "/virtualenvs/project/lib/python3.9/site-packages/tyrannosaurus/cli.py", line 227, in sync
context = Context(Path(os.getcwd()), dry_run=state.dry_run)
File "/virtualenvs/project/lib/python3.9/site-packages/tyrannosaurus/context.py", line 73, in __init__
self.sources = {
File "/virtualenvs/project/lib/python3.9/site-packages/tyrannosaurus/context.py", line 74, in <dictcomp>
k: Source.parse(v, data)
File "/virtualenvs/project/lib/python3.9/site-packages/tyrannosaurus/context.py", line 43, in parse
LiteralParser(
File "/virtualenvs/project/lib/python3.9/site-packages/tyrannosaurus/parser.py", line 29, in __init__
self.license = License.of(license_name)
File "/virtualenvs/project/lib/python3.9/site-packages/tyrannosaurus/enums.py", line 193, in of
raise LookupError(f"Could not find {value}")
LookupError: Could not find Proprietary
I checked the code and there was an Enum with some of the licenses and no "Proprietary":
class License(str, enum.Enum):
agpl3 = "agpl3"
apache2 = "apache2"
cc0 = "cc0"
ccby = "ccby"
ccbync = "ccbync"
gpl3 = "gpl3"
lgpl3 = "lgpl3"
mit = "mit"
mpl2 = "mpl2"
This is a bit tricky. For now, just don't use sync
. If you're not using readthedocs, conda, docker, codemeta, or citation.cff, then there's not much to sync anyway. Just make sure to run poetry lock
to keep your dependencies synced.
The issue is that, conceptually, licenses have URLs and other associated data, which "proprietary" of course does not.
I might get around to figuring out a fix eventually.