Skip to content

Commit

Permalink
Merge pull request #38 from VoIlAlex/master
Browse files Browse the repository at this point in the history
Sync `develop` and `master`
  • Loading branch information
VoIlAlex authored Feb 14, 2024
2 parents fdead16 + 99b4fe7 commit 26e0ddd
Show file tree
Hide file tree
Showing 4 changed files with 148 additions and 83 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/publish-to-pypi-rex.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Build

on:
push:
tags:
- '*'

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install requirements.txt
run: >-
python -m
pip install -r requirements.txt
- name: Install requirements.test.txt
run: >-
python -m
pip install -r requirements.test.txt
- name: Run unit tests
run: >-
python -m pytest tests/unittests
- name: Run linters
run: |
python -m flake8 requirements_txt --ignore=E501
python -m black requirements_txt --check
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Set rex as active alias
run: >-
mv ./aliases/rex/setup.py ./setup.py
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN_REX }}
88 changes: 88 additions & 0 deletions aliases/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
from distutils.core import setup
import os
from setuptools import find_packages
from setuptools.command.install import install

# User-friendly description from README.md
current_directory = os.path.dirname(
os.path.dirname(os.path.abspath(__file__))
)
try:
with open(os.path.join(current_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
except Exception:
long_description = ''


def run_setup(package_name: str, directory: str = '.'):
setup(
# Name of the package
name=package_name,
# Packages to include into the distribution
packages=find_packages(directory),
# Start with a small number and increase it with
# every change you make https://semver.org
version='2.0.3',
# Chose a license from here: https: //
# help.github.com / articles / licensing - a -
# repository. For example: MIT
license='MIT',
# Short description of your library
description='Automatically add and delete modules to requirements.txt installing them using pip.',
# Long description of your library
long_description=long_description,
long_description_content_type='text/markdown',
# Your name
author='Ilya Vouk',
# Your email
author_email='ilya.vouk@gmail.com',
# Either the link to your github or to your website
url='https://github.com/VoIlAlex/requirements-txt',
# Link from which the project can be downloaded
download_url='https://github.com/VoIlAlex/requirements-txt/archive/refs/tags/v1.1.10.zip',
# List of keywords
keywords=[
'pip',
'requirements.txt',
'dependency',
'dependencies',
'requirements',
'packages',
'wrapper',
'repository'
],
# List of packages to install with this one
install_requires=[
'appdata==2.2.1',
'click==8.0.3',
'colored==1.4.3',
],
entry_points={
'console_scripts': [
'requirements-txt-cli = requirements_txt.commands:cli',
'rt-cli = requirements_txt.commands:cli'
],
},
scripts=[
'scripts/rt',
'scripts/requirements-txt'
],
# https://pypi.org/classifiers/
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: Unix',
'Topic :: Software Development',
'Topic :: System :: Installation/Setup',
'Topic :: Terminals',
'Topic :: Utilities',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
]
)
4 changes: 4 additions & 0 deletions aliases/rex/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from aliases.base import run_setup


run_setup('rex')
85 changes: 2 additions & 83 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,85 +1,4 @@
from distutils.core import setup
import os
from setuptools import find_packages
from setuptools.command.install import install
from aliases.base import run_setup

# User-friendly description from README.md
current_directory = os.path.dirname(os.path.abspath(__file__))
try:
with open(os.path.join(current_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
except Exception:
long_description = ''


setup(
# Name of the package
name='to-requirements.txt',
# Packages to include into the distribution
packages=find_packages('.'),
# Start with a small number and increase it with
# every change you make https://semver.org
version='2.0.0',
# Chose a license from here: https: //
# help.github.com / articles / licensing - a -
# repository. For example: MIT
license='MIT',
# Short description of your library
description='Automatically add and delete modules to requirements.txt installing them using pip.',
# Long description of your library
long_description=long_description,
long_description_content_type='text/markdown',
# Your name
author='Ilya Vouk',
# Your email
author_email='ilya.vouk@gmail.com',
# Either the link to your github or to your website
url='https://github.com/VoIlAlex/requirements-txt',
# Link from which the project can be downloaded
download_url='https://github.com/VoIlAlex/requirements-txt/archive/refs/tags/v1.1.10.zip',
# List of keywords
keywords=[
'pip',
'requirements.txt',
'dependency',
'dependencies',
'requirements',
'packages',
'wrapper',
'repository'
],
# List of packages to install with this one
install_requires=[
'appdata==2.2.1',
'click==8.0.3',
'colored==1.4.3',
],
entry_points={
'console_scripts': [
'requirements-txt-cli = requirements_txt.commands:cli',
'rt-cli = requirements_txt.commands:cli'
],
},
scripts=[
'scripts/rt',
'scripts/requirements-txt'
],
# https://pypi.org/classifiers/
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: Unix',
'Topic :: Software Development',
'Topic :: System :: Installation/Setup',
'Topic :: Terminals',
'Topic :: Utilities',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
]
)
run_setup('to-requirements.txt')

0 comments on commit 26e0ddd

Please sign in to comment.