diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8b77af..489dba6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: branches: - 'main' - 'release-**' + workflow_dispatch: jobs: build: runs-on: ubuntu-latest @@ -16,6 +17,7 @@ jobs: - "3.9" - "3.10" - "3.11" + - "3.12" name: Python ${{ matrix.python-version }} steps: - uses: actions/checkout@v3 diff --git a/pigar/__main__.py b/pigar/__main__.py index d5f8560..8ae3c27 100644 --- a/pigar/__main__.py +++ b/pigar/__main__.py @@ -120,8 +120,9 @@ def gohome(): 'comparison_specifier', default='==', show_default=True, - type=click.Choice(['==', '~=', '>=', '>']), - help='Part of version specifier, e.g. `abc==1.0`(see PEP 440 for details).', + type=click.Choice(['==', '~=', '>=', '>', '-']), + help='Part of version specifier, e.g. `abc==1.0`(see PEP 440 for details).' + ' Can be `-` to completely remove version.', ) @click.option( '--show-differences/--dont-show-differences', diff --git a/pigar/dist.py b/pigar/dist.py index 4d78e2c..5f3f3be 100644 --- a/pigar/dist.py +++ b/pigar/dist.py @@ -183,11 +183,13 @@ def contains_file(self, file): def as_requirement( self, operator: str = '==', spaces_around_operator: str = '' ) -> str: - req = "" if self.editable and self.url: req = f"-e {self.url}" else: - req = f"{self.name}{spaces_around_operator}{operator}{spaces_around_operator}{self.version}" + req = self.name + if operator != '-': + req += f"{spaces_around_operator}{operator}"\ + f"{spaces_around_operator}{self.version}" return "\n".join(list(self.comments) + [str(req)]) def __str__(self) -> str: diff --git a/requirements/py3.12.txt b/requirements/py3.12.txt new file mode 100644 index 0000000..35ebc2c --- /dev/null +++ b/requirements/py3.12.txt @@ -0,0 +1,9 @@ +# Automatically generated by https://github.com/damnever/pigar. + +# pigar/dist.py: 28 +aiohttp==3.9.0 +# pigar/__main__.py: 24 +# pigar/tests/test_cli.py: 9 +click==8.1.3 +# pigar/parser.py: 15 +nbformat==5.7.3