hassle


Namehassle JSON
Version 3.1.8 PyPI version JSON
download
home_page
SummaryCreate, build, test, and publish Python projects and packages.
upload_time2024-02-24 18:16:23
maintainer
docs_urlNone
author
requires_python<3.12,>=3.10
license
keywords automation build devops packaging test
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Hassle

Automate creating, building, testing, and publishing Python packages from the command line.   


## Installation

Install with:

<pre>
pip install hassle
</pre>

You should be able to type `hassle help` in your terminal and see a list of commands:
![](imgs/hassle_HassleShell.svg)


### Additional setup:

Install git and add it to your PATH if it isn't already.  
Some parts of this tool may require [communicating with Github]((https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git)).  
You will also need to register a [pypi account](https://pypi.org/account/register/) if you want to publish packages to https://pypi.org with this tool.  
Once you've created and validated an account, you will need to follow the directions to generate an [api key](https://pypi.org/help/#apitoken).  
Copy the key and in your home directory, create a '.pypirc' file if it doesn't already exist.  
Edit the file so it contains the following (don't include the brackets around your api key):

![](imgs/pypirc.svg)

## Configuration

After installation and the above additional setup, it is a good idea to run the 'configure' command.
This isn't required and a blank config will be generated whenever it is needed if it doesn't exist.
This info, if provided, is used to populate a new project's 'pyproject.toml' file.
Typing `hassle help configure`:
![](imgs/hassle_configure.svg)

You can also view the current contents with the `config` command:
![](imgs/config.svg)

## Generating New Projects
New projects are generated with the `new` command:  
![](imgs/hassle_new.svg)

Most of these options pertain to prefilling the generated 'pyproject.toml' file.  
As a simple example we'll create a new package called 'nyquil':
![](imgs/new_use.svg)

A new folder in your current working directory called 'nyquil' should now exist.  
It should have the following structure:
![](imgs/folder_tree.svg)


**Note: By default an MIT License is added to the project. Pass the `-nl/--no_license` flag to prevent this behavior.**  
If you open the 'pyproject.toml' file it should look like the following except
for the 'project.authors' and 'project.urls' sections:
![](imgs/pyproject.svg)

The package would do absolutely nothing, but with the generated files we do have the
viable minimum to build an installable python package.


## Running Tests

Hassle uses [Pytest](https://pypi.org/project/pytest/) and [Coverage](https://pypi.org/project/coverage/) to run tests.  
When we invoke the `hassle test` command,
we should see something like this (pretending we have added test functions to `tests/test_nyquil.py`):
![](imgs/test.svg)


## Building

Building the package is as simple as using:

<pre>
>hassle build
</pre>

By default, the build command will:  
1. Run any tests in the `tests` folder (abandoning the build if any fail).  
2. Format source files with isort and black.  
3. Scan project import statements and add any missing packages to the pyproject `dependencies` field.  
4. Use [pdoc](https://pypi.org/project/pdoc/) to generate documentation (located in a created `docs` folder).  
5. Run `python -m build .` to generate the `tar.gz` and `.whl` files (located in a created `dist` folder).  


## Publishing

Assuming you've set up a [PyPi](https://pypi.org/) account, generated the api key, and configured the '.pypirc' 
file as mentioned earlier, then you can publish the current version of your package by running:

<pre>
>hassle publish
</pre>


## Updating

When the time comes to make changes to your package, the `hassle update` command makes it easy.  
This command needs at least one argument according to the type of update: `major`, `minor`, or `patch`.  
This argument tells Hassle how to increment the project version.  
Hassle uses the [semantic versioning standard](https://semver.org/),
so, for example, if your current version is `1.2.3` then 

`>hassle update major` bumps to `2.0.0`,  
`>hassle update minor` bumps to `1.3.0`,  
and  
`>hassle update patch` bumps to `1.2.4`.  

By default, the update command will:  
1. Run any tests in the `tests` folder (abandoning the update if any fail).  
2. Increment the project version.  
3. Run the build process as outlined above (minus step 1.).  
4. Make a commit with the message `chore: build {project_version}`.  
5. Git tag using the tag prefix in your `hassle_config.toml` file and the new project version.  
6. Generate/update the `CHANGELOG.md` file using [auto-changelog](https://pypi.org/project/auto-changelog/).  
(Normally `auto-changelog` overwrites the changelog file, but Hassle does some extra things so that any manual changes you make to the changelog are preserved).  
7. Git commit the changelog.  
8. Pull/push the current branch with the remote origin.  
9. Publish the updated package if the update command was run with the `-p` flag.  
10. Install the updated package if the update command was run with the `-i` flag.  


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "hassle",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "<3.12,>=3.10",
    "maintainer_email": "",
    "keywords": "automation,build,devops,packaging,test",
    "author": "",
    "author_email": "Matt Manes <mattmanes@pm.me>",
    "download_url": "https://files.pythonhosted.org/packages/c3/33/00a9b32c2147120199884149e7081789835d7f1dc7cd26bbffe77d9a3d48/hassle-3.1.8.tar.gz",
    "platform": null,
    "description": "# Hassle\n\nAutomate creating, building, testing, and publishing Python packages from the command line.   \n\n\n## Installation\n\nInstall with:\n\n<pre>\npip install hassle\n</pre>\n\nYou should be able to type `hassle help` in your terminal and see a list of commands:\n![](imgs/hassle_HassleShell.svg)\n\n\n### Additional setup:\n\nInstall git and add it to your PATH if it isn't already.  \nSome parts of this tool may require [communicating with Github]((https://docs.github.com/en/get-started/getting-started-with-git/caching-your-github-credentials-in-git)).  \nYou will also need to register a [pypi account](https://pypi.org/account/register/) if you want to publish packages to https://pypi.org with this tool.  \nOnce you've created and validated an account, you will need to follow the directions to generate an [api key](https://pypi.org/help/#apitoken).  \nCopy the key and in your home directory, create a '.pypirc' file if it doesn't already exist.  \nEdit the file so it contains the following (don't include the brackets around your api key):\n\n![](imgs/pypirc.svg)\n\n## Configuration\n\nAfter installation and the above additional setup, it is a good idea to run the 'configure' command.\nThis isn't required and a blank config will be generated whenever it is needed if it doesn't exist.\nThis info, if provided, is used to populate a new project's 'pyproject.toml' file.\nTyping `hassle help configure`:\n![](imgs/hassle_configure.svg)\n\nYou can also view the current contents with the `config` command:\n![](imgs/config.svg)\n\n## Generating New Projects\nNew projects are generated with the `new` command:  \n![](imgs/hassle_new.svg)\n\nMost of these options pertain to prefilling the generated 'pyproject.toml' file.  \nAs a simple example we'll create a new package called 'nyquil':\n![](imgs/new_use.svg)\n\nA new folder in your current working directory called 'nyquil' should now exist.  \nIt should have the following structure:\n![](imgs/folder_tree.svg)\n\n\n**Note: By default an MIT License is added to the project. Pass the `-nl/--no_license` flag to prevent this behavior.**  \nIf you open the 'pyproject.toml' file it should look like the following except\nfor the 'project.authors' and 'project.urls' sections:\n![](imgs/pyproject.svg)\n\nThe package would do absolutely nothing, but with the generated files we do have the\nviable minimum to build an installable python package.\n\n\n## Running Tests\n\nHassle uses [Pytest](https://pypi.org/project/pytest/) and [Coverage](https://pypi.org/project/coverage/) to run tests.  \nWhen we invoke the `hassle test` command,\nwe should see something like this (pretending we have added test functions to `tests/test_nyquil.py`):\n![](imgs/test.svg)\n\n\n## Building\n\nBuilding the package is as simple as using:\n\n<pre>\n>hassle build\n</pre>\n\nBy default, the build command will:  \n1. Run any tests in the `tests` folder (abandoning the build if any fail).  \n2. Format source files with isort and black.  \n3. Scan project import statements and add any missing packages to the pyproject `dependencies` field.  \n4. Use [pdoc](https://pypi.org/project/pdoc/) to generate documentation (located in a created `docs` folder).  \n5. Run `python -m build .` to generate the `tar.gz` and `.whl` files (located in a created `dist` folder).  \n\n\n## Publishing\n\nAssuming you've set up a [PyPi](https://pypi.org/) account, generated the api key, and configured the '.pypirc' \nfile as mentioned earlier, then you can publish the current version of your package by running:\n\n<pre>\n>hassle publish\n</pre>\n\n\n## Updating\n\nWhen the time comes to make changes to your package, the `hassle update` command makes it easy.  \nThis command needs at least one argument according to the type of update: `major`, `minor`, or `patch`.  \nThis argument tells Hassle how to increment the project version.  \nHassle uses the [semantic versioning standard](https://semver.org/),\nso, for example, if your current version is `1.2.3` then \n\n`>hassle update major` bumps to `2.0.0`,  \n`>hassle update minor` bumps to `1.3.0`,  \nand  \n`>hassle update patch` bumps to `1.2.4`.  \n\nBy default, the update command will:  \n1. Run any tests in the `tests` folder (abandoning the update if any fail).  \n2. Increment the project version.  \n3. Run the build process as outlined above (minus step 1.).  \n4. Make a commit with the message `chore: build {project_version}`.  \n5. Git tag using the tag prefix in your `hassle_config.toml` file and the new project version.  \n6. Generate/update the `CHANGELOG.md` file using [auto-changelog](https://pypi.org/project/auto-changelog/).  \n(Normally `auto-changelog` overwrites the changelog file, but Hassle does some extra things so that any manual changes you make to the changelog are preserved).  \n7. Git commit the changelog.  \n8. Pull/push the current branch with the remote origin.  \n9. Publish the updated package if the update command was run with the `-p` flag.  \n10. Install the updated package if the update command was run with the `-i` flag.  \n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Create, build, test, and publish Python projects and packages.",
    "version": "3.1.8",
    "project_urls": {
        "Documentation": "https://github.com/matt-manes/hassle/tree/main/docs",
        "Homepage": "https://github.com/matt-manes/hassle",
        "Source code": "https://github.com/matt-manes/hassle/tree/main/src/hassle"
    },
    "split_keywords": [
        "automation",
        "build",
        "devops",
        "packaging",
        "test"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1106a2f7366958220a5910e17a5081179619d289341838c698cb743b2fdc9aba",
                "md5": "cfd0e2371fdc0ad8306cb2463ed7d490",
                "sha256": "eb5e661afb9a81965e7f54d1f03c397d4b0523bbda706f0ff7d1ed97560d57fe"
            },
            "downloads": -1,
            "filename": "hassle-3.1.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cfd0e2371fdc0ad8306cb2463ed7d490",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.10",
            "size": 18046,
            "upload_time": "2024-02-24T18:16:22",
            "upload_time_iso_8601": "2024-02-24T18:16:22.357057Z",
            "url": "https://files.pythonhosted.org/packages/11/06/a2f7366958220a5910e17a5081179619d289341838c698cb743b2fdc9aba/hassle-3.1.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c33300a9b32c2147120199884149e7081789835d7f1dc7cd26bbffe77d9a3d48",
                "md5": "f9e8ee49284b2b2c34f1602f2eb9dd18",
                "sha256": "cb1d494d63f96b539d658ca6679a70cada79e2cff4d9fe93346437fe9215c95b"
            },
            "downloads": -1,
            "filename": "hassle-3.1.8.tar.gz",
            "has_sig": false,
            "md5_digest": "f9e8ee49284b2b2c34f1602f2eb9dd18",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<3.12,>=3.10",
            "size": 14023,
            "upload_time": "2024-02-24T18:16:23",
            "upload_time_iso_8601": "2024-02-24T18:16:23.844213Z",
            "url": "https://files.pythonhosted.org/packages/c3/33/00a9b32c2147120199884149e7081789835d7f1dc7cd26bbffe77d9a3d48/hassle-3.1.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-24 18:16:23",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "matt-manes",
    "github_project": "hassle",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "hassle"
}
        
Elapsed time: 0.18757s