Skip to content

Commit 09c3f0e

Browse files
committed
Created project-markers pkg
1 parent e0b4d2b commit 09c3f0e

15 files changed

Lines changed: 851 additions & 0 deletions

File tree

project-markers/docs/LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# 🏛️ MIT License
2+
3+
**Copyright © 2026 [Adam Lui](https://github.com/adamlui)**
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

project-markers/docs/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<a id="top"></a>
2+
3+
# > project-markers
4+
5+
<a href="https://pepy.tech/projects/project-markers">
6+
<img height=31 src="https://img.shields.io/pepy/dt/project-markers?logo=weightsandbiases&color=af68ff&logoColor=white&labelColor=464646&style=for-the-badge"></img></a>
7+
<a href="https://github.com/adamlui/python-utils/releases/tag/project-markers-1.0.0">
8+
<img height=31 src="https://img.shields.io/badge/Latest_Build-1.0.0-32fcee.svg?logo=icinga&logoColor=white&labelColor=464646&style=for-the-badge"></a>
9+
<a href="https://github.com/adamlui/python-utils/blob/main/project-markers/docs/LICENSE.md">
10+
<img height=31 src="https://img.shields.io/badge/License-MIT-f99b27.svg?logo=internetarchive&logoColor=white&labelColor=464646&style=for-the-badge"></a>
11+
<a href="https://www.codefactor.io/repository/github/adamlui/python-utils">
12+
<img height=31 src="https://img.shields.io/codefactor/grade/github/adamlui/python-utils?label=Code+Quality&logo=codefactor&logoColor=white&labelColor=464646&color=a0fc55&style=for-the-badge"></a>
13+
<a href="https://sonarcloud.io/component_measures?metric=new_vulnerabilities&id=adamlui_python-utils">
14+
<img height=31 src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fsonarcloud.io%2Fapi%2Fmeasures%2Fcomponent%3Fcomponent%3Dadamlui_python-utils%26metricKeys%3Dvulnerabilities&query=%24.component.measures.0.value&style=for-the-badge&logo=sonarcloud&logoColor=white&labelColor=464646&label=Vulnerabilities&color=fafc74"></a>
15+
16+
> ### _Common project root markers._
17+
18+
It's just a JSON file, so you can use it in any environment.
19+
20+
## Installation
21+
22+
```bash
23+
pip install project-markers
24+
```
25+
26+
## Usage
27+
28+
```py
29+
import project_markers
30+
31+
print(project_markers)
32+
# => ['.ansible-lint', '.bazelrc', '.browserslistrc', '.buckconfig', ...]
33+
```
34+
35+
The list includes markers from many tools and ecosystems, including:
36+
37+
- Version control (.git, .hg, .svn)
38+
- Python (pyproject.toml, setup.py, requirements.txt)
39+
- JavaScript (package.json, yarn.lock, tsconfig.json)
40+
- Docker/K8s (Dockerfile, docker-compose.yml)
41+
- CI/CD (.github, .gitlab-ci.yml, Jenkinsfile)
42+
43+
## MIT License
44+
45+
Copyright © 2026 [Adam Lui](https://github.com/adamlui).
46+
47+
#
48+
49+
<a href="#top">Back to top ↑</a>

project-markers/noxfile.py

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
from pathlib import Path
2+
from types import SimpleNamespace as sn
3+
4+
import nox
5+
6+
pkg = sn(dir=Path(__file__).parent.name)
7+
pkg.name = pkg.dir.replace('-', '_')
8+
paths = sn(utils=sn(bump='utils/bump.py', clean='utils/clean.py', publish='utils/publish.sh'))
9+
10+
def session(func) : return nox.session(venv_backend='none')(func)
11+
12+
# SESSIONS
13+
14+
@session
15+
def dev(session) : session.run('pip', 'install', '-e', '.') ; session.run(pkg.dir, '--help', *session.posargs)
16+
@session
17+
def debug(session) : session.run('py', '-m', pkg.name, '--debug', *session.posargs, env={ 'PYTHONPATH': 'src' })
18+
19+
@session
20+
def bump_patch(session, no_push=True):
21+
cmd = ['py', paths.utils.bump, '--patch']
22+
if no_push : cmd.append('--no-push')
23+
session.run(*cmd, *session.posargs)
24+
@session
25+
def bump_minor(session, no_push=True):
26+
cmd = ['py', paths.utils.bump, '--minor']
27+
if no_push : cmd.append('--no-push')
28+
session.run(*cmd, *session.posargs)
29+
@session
30+
def bump_feat(session, no_push=True):
31+
bump_minor(session, no_push)
32+
@session
33+
def bump_major(session, no_push=True):
34+
cmd = ['py', paths.utils.bump, '--major']
35+
if no_push : cmd.append('--no-push')
36+
session.run(*cmd, *session.posargs)
37+
38+
@session
39+
def build(session) : clean(session) ; session.run('py', '-m', 'build') ; print('Build complete!')
40+
@session
41+
def publish(session) : session.run('bash', paths.utils.publish, *session.posargs)
42+
43+
@session
44+
def deploy_patch(session) : bump_patch(session, no_push=False) ; build(session) ; publish(session)
45+
@session
46+
def deploy_minor(session) : bump_minor(session, no_push=False) ; build(session) ; publish(session)
47+
@session
48+
def deploy_feat(session) : deploy_minor(session)
49+
@session
50+
def deploy_major(session) : bump_major(session, no_push=False) ; build(session) ; publish(session)
51+
52+
@session
53+
def clean(session) : session.run('py', paths.utils.clean)

project-markers/pyproject.toml

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=61.0",
4+
"wheel"
5+
]
6+
build-backend = "setuptools.build_meta"
7+
8+
[project]
9+
name = "project-markers"
10+
version = "1.0.0"
11+
description = "List of files that indicate a project root"
12+
authors = [
13+
{ name = "Adam Lui", email = "adam@kudoai.com" }
14+
]
15+
readme = "docs/README.md"
16+
license = "MIT"
17+
license-files = [
18+
"docs/LICENSE.md"
19+
]
20+
requires-python = ">=2.6,<4.0"
21+
keywords = [
22+
"detection",
23+
"files",
24+
"json",
25+
"markers",
26+
"project",
27+
"root"
28+
]
29+
classifiers = [
30+
"Development Status :: 5 - Production/Stable",
31+
"Intended Audience :: Developers",
32+
"Intended Audience :: Information Technology",
33+
"Intended Audience :: Science/Research",
34+
"Natural Language :: English",
35+
"Operating System :: OS Independent",
36+
"Programming Language :: Python",
37+
"Programming Language :: Python :: 2",
38+
"Programming Language :: Python :: 2.6",
39+
"Programming Language :: Python :: 2.7",
40+
"Programming Language :: Python :: 3",
41+
"Programming Language :: Python :: 3.8",
42+
"Programming Language :: Python :: 3.9",
43+
"Programming Language :: Python :: 3.10",
44+
"Programming Language :: Python :: 3.11",
45+
"Programming Language :: Python :: 3.12",
46+
"Programming Language :: Python :: 3.13",
47+
"Programming Language :: Python :: 3.14",
48+
"Programming Language :: Python :: 3.15",
49+
"Topic :: Software Development",
50+
"Topic :: Software Development :: Libraries",
51+
"Topic :: Software Development :: Libraries :: Python Modules",
52+
"Topic :: Software Development :: Version Control",
53+
"Topic :: Utilities"
54+
]
55+
56+
[project.urls]
57+
Changelog = "https://github.com/adamlui/python-utils/releases/tag/project-markers-1.0.0"
58+
Documentation = "https://github.com/adamlui/python-utils/tree/main/project-markers/docs"
59+
Funding = "https://github.com/sponsors/adamlui"
60+
Homepage = "https://github.com/adamlui/python-utils/tree/main/project-markers/#readme"
61+
Issues = "https://github.com/adamlui/python-utils/issues"
62+
"PyPI Stats" = "https://pepy.tech/projects/project-markers"
63+
Releases = "https://github.com/adamlui/python-utils/releases"
64+
Repository = "https://github.com/adamlui/python-utils"
65+
66+
[project.optional-dependencies]
67+
dev = [
68+
"nox>=2026.2.9",
69+
"tomli>=2.0.0,<3.0.0",
70+
"tomli-w>=0.1.0,<2.0.0"
71+
]
72+
73+
[tool.setuptools.packages.find]
74+
where = ["src"]
75+
76+
[tool.setuptools.package-data]
77+
"project_markers" = ["project_markers.json"]
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import json, os, sys
2+
3+
with open(os.path.join(os.path.dirname(__file__), 'project_markers.json')) as file:
4+
project_markers = json.load(file)
5+
6+
sys.modules[__name__] = project_markers

0 commit comments

Comments
 (0)