demopythonlib


Namedemopythonlib JSON
Version 0.1.5 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2024-06-11 04:11:16
maintainerNone
docs_urlNone
authorNhanDD3
requires_python>=3.10.0
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Guide
0. Require:
    - Python >= 3.7
    - Poetry >= 1.2.0
1. Prepare
    - Install poetry 
    - Using poetry to create new source or init to existed source

2. Configure pyproject.toml
    - Minimum requirements
    ```
    [tool.poetry]
    name = "demopythonlib"      -> project / package name
    version = "0.1.0"           -> pypi only accept code with new version 
    packages = [{include = "demopythonlib"}] -> is package should be packed then push to pypi
    
    ...

    [tool.poetry.dependencies]
    python = "^3.12"            -> python version should fit with your project
    ...

    [tool.poetry.scripts]
    say-hi = "demopythonlib:say_hi"     -> add custom command to run directly from terminal -> like "celery -A worker ...."
    ...

    ```
3. Prepare your pypi account
    - Create new if you need: https://pypi.org/account/register/ 
    - Add 2FA to your account
    - Login > Account Settings > Tokens
    - Add API Token: create a token for all projects (for first time publish) - copy it and securely storage

4. Publish first time
    - Build 
        ```
        $ poetry build
        
        ->  Building demopythonlib (0.1.0)
            - Building sdist
            - Built demopythonlib-0.1.0.tar.gz
            - Building wheel
            - Built demopythonlib-0.1.0-py3-none-any.whl
        ```
    - Add credential
        ``` https://python-poetry.org/docs/repositories/#configuring-credentials
        $ poetry config pypi-token.pypi <your-token>
        ```
    - Publish
        ```
        $ poetry publish

        ->  Publishing demopythonlib (0.1.0) to PyPI
            - Uploading demopythonlib-0.1.0-py3-none-any.whl 100%
            - Uploading demopythonlib-0.1.0.tar.gz 100%
        ```

    - Recheck: go to https://pypi.org/project/project-name/
        ```
        for my example ->  https://pypi.org/project/demopythonlib/
        ```

5. Revoke your full access token above, then create new token for this project for security 

6. Publish new version
    - In pyproject.toml, change version manually 
        ``` pyproject.toml
        [tool.poetry]
        name = "demopythonlib"
        version = "0.1.1"       -> change from 0.1.0 to 0.1.1 for example  
        
        ```
    - Or use bump2version (https://github.com/c4urself/bump2version)
    - Build then publish
        ```
        $ poetry build

        ->  Building demopythonlib (0.1.1)
            - Building sdist
            - Built demopythonlib-0.1.1.tar.gz
            - Building wheel
            - Built demopythonlib-0.1.1-py3-none-any.whl


        $ poetry publish

        ->  Publishing demopythonlib (0.1.1) to PyPI
            - Uploading demopythonlib-0.1.1-py3-none-any.whl 100%
            - Uploading demopythonlib-0.1.1.tar.gz 100%
        ```

7. Integrate locally
    - From main project, You need to import this library locally, 
    ```
    $ poetry add ./<path/to/your/lib> --editable
    ```
    - Use option "--editable" if you want changes in your local library to be reflected immediately in your project

8. What next? 
    - Add precommit, bump2verion, ...
    - Add tests
    - Integrate with github/gitlab
        + run workflow CI/CD  
        + build then publish new release to pypi automatically

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "demopythonlib",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10.0",
    "maintainer_email": null,
    "keywords": null,
    "author": "NhanDD3",
    "author_email": "hp.duongducnhan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/f7/3b/f35dc0abdc35c8091efaba9a852ed486afb1d671b3723e23c95473281e0e/demopythonlib-0.1.5.tar.gz",
    "platform": null,
    "description": "# Guide\n0. Require:\n    - Python >= 3.7\n    - Poetry >= 1.2.0\n1. Prepare\n    - Install poetry \n    - Using poetry to create new source or init to existed source\n\n2. Configure pyproject.toml\n    - Minimum requirements\n    ```\n    [tool.poetry]\n    name = \"demopythonlib\"      -> project / package name\n    version = \"0.1.0\"           -> pypi only accept code with new version \n    packages = [{include = \"demopythonlib\"}] -> is package should be packed then push to pypi\n    \n    ...\n\n    [tool.poetry.dependencies]\n    python = \"^3.12\"            -> python version should fit with your project\n    ...\n\n    [tool.poetry.scripts]\n    say-hi = \"demopythonlib:say_hi\"     -> add custom command to run directly from terminal -> like \"celery -A worker ....\"\n    ...\n\n    ```\n3. Prepare your pypi account\n    - Create new if you need: https://pypi.org/account/register/ \n    - Add 2FA to your account\n    - Login > Account Settings > Tokens\n    - Add API Token: create a token for all projects (for first time publish) - copy it and securely storage\n\n4. Publish first time\n    - Build \n        ```\n        $ poetry build\n        \n        ->  Building demopythonlib (0.1.0)\n            - Building sdist\n            - Built demopythonlib-0.1.0.tar.gz\n            - Building wheel\n            - Built demopythonlib-0.1.0-py3-none-any.whl\n        ```\n    - Add credential\n        ``` https://python-poetry.org/docs/repositories/#configuring-credentials\n        $ poetry config pypi-token.pypi <your-token>\n        ```\n    - Publish\n        ```\n        $ poetry publish\n\n        ->  Publishing demopythonlib (0.1.0) to PyPI\n            - Uploading demopythonlib-0.1.0-py3-none-any.whl 100%\n            - Uploading demopythonlib-0.1.0.tar.gz 100%\n        ```\n\n    - Recheck: go to https://pypi.org/project/project-name/\n        ```\n        for my example ->  https://pypi.org/project/demopythonlib/\n        ```\n\n5. Revoke your full access token above, then create new token for this project for security \n\n6. Publish new version\n    - In pyproject.toml, change version manually \n        ``` pyproject.toml\n        [tool.poetry]\n        name = \"demopythonlib\"\n        version = \"0.1.1\"       -> change from 0.1.0 to 0.1.1 for example  \n        \n        ```\n    - Or use bump2version (https://github.com/c4urself/bump2version)\n    - Build then publish\n        ```\n        $ poetry build\n\n        ->  Building demopythonlib (0.1.1)\n            - Building sdist\n            - Built demopythonlib-0.1.1.tar.gz\n            - Building wheel\n            - Built demopythonlib-0.1.1-py3-none-any.whl\n\n\n        $ poetry publish\n\n        ->  Publishing demopythonlib (0.1.1) to PyPI\n            - Uploading demopythonlib-0.1.1-py3-none-any.whl 100%\n            - Uploading demopythonlib-0.1.1.tar.gz 100%\n        ```\n\n7. Integrate locally\n    - From main project, You need to import this library locally, \n    ```\n    $ poetry add ./<path/to/your/lib> --editable\n    ```\n    - Use option \"--editable\" if you want changes in your local library to be reflected immediately in your project\n\n8. What next? \n    - Add precommit, bump2verion, ...\n    - Add tests\n    - Integrate with github/gitlab\n        + run workflow CI/CD  \n        + build then publish new release to pypi automatically\n",
    "bugtrack_url": null,
    "license": null,
    "summary": null,
    "version": "0.1.5",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "da09cc20e3829ba666e5074df98598ffcbfc34ad3772ddd3bfa2633e719bcd02",
                "md5": "37c6773591bda89d014f1a8e25012405",
                "sha256": "7a40793cdfff7009edab1294d9a00b32d7a6c346493b229bb673b7131f021e36"
            },
            "downloads": -1,
            "filename": "demopythonlib-0.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "37c6773591bda89d014f1a8e25012405",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10.0",
            "size": 3172,
            "upload_time": "2024-06-11T04:11:14",
            "upload_time_iso_8601": "2024-06-11T04:11:14.948672Z",
            "url": "https://files.pythonhosted.org/packages/da/09/cc20e3829ba666e5074df98598ffcbfc34ad3772ddd3bfa2633e719bcd02/demopythonlib-0.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f73bf35dc0abdc35c8091efaba9a852ed486afb1d671b3723e23c95473281e0e",
                "md5": "ab2538c0e714153b3961a5945c09033e",
                "sha256": "51de3f316a8c46210ddeefde41c9e9325fd6c04e7196ac3610aaed426f438b6a"
            },
            "downloads": -1,
            "filename": "demopythonlib-0.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "ab2538c0e714153b3961a5945c09033e",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10.0",
            "size": 2211,
            "upload_time": "2024-06-11T04:11:16",
            "upload_time_iso_8601": "2024-06-11T04:11:16.618002Z",
            "url": "https://files.pythonhosted.org/packages/f7/3b/f35dc0abdc35c8091efaba9a852ed486afb1d671b3723e23c95473281e0e/demopythonlib-0.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-11 04:11:16",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "demopythonlib"
}
        
Elapsed time: 0.32145s